Bug 11994 – typeof(this) in constraint of member function template should reflect method qualifier
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-01-25T08:51:00Z
Last change time
2014-01-25T09:04:13Z
Keywords
wrong-code
Assigned to
nobody
Creator
k.hara.pg
Comments
Comment #0 by k.hara.pg — 2014-01-25T08:51:50Z
With 2.064:
bool printType(T, size_t ln = __LINE__)()
{
pragma(msg, T.stringof);
return true;
}
struct S
{
void foo()() const
if (printType!(typeof(this)))
{}
const void bar()()
if (printType!(typeof(this)))
{}
}
void main()
{
S s;
s.foo(); // const(S)
s.bar(); // S
}
Both of s.foo() and s.bar() should print const(S)
Comment #1 by k.hara.pg — 2014-01-25T09:04:13Z
Merge into the regression issue 11993.
*** This issue has been marked as a duplicate of issue 11993 ***