https://d.puremagic.com/issues/show_bug.cgi?id=11994
Summary: typeof(this) in constraint of member function template
should reflect method qualifier
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Keywords: wrong-code
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Kenji Hara <[email protected]> 2014-01-25 08:51:50 PST ---
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)
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------