Bug 11993 – [REG] typeof(this) in constraint of member function template should reflect method qualifier

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-01-25T08:32:00Z
Last change time
2014-01-27T19:24:47Z
Keywords
pull, wrong-code
Assigned to
nobody
Creator
monarchdodra

Comments

Comment #0 by monarchdodra — 2014-01-25T08:32:44Z
This *just* broke on master: //---- bool fun(T)() { pragma(msg, T.stringof); return true; } struct S { void foo()() const if (fun!(typeof(this))) {} } void main() { S s; s.foo(); } //---- master: "S" 2.064.2: "const(S)" Here, "foo" is const, so in the template constraint, "this" should be "const(S)". Yet when querying "fun", it prints "S". This regression is responsible for the failures here: https://d.puremagic.com/test-results/pull-history.ghtml?projectid=1&repoid=3&pullid=1049 My guess is there is a DMD pull around between 2014-01-23T21:00 and 2014-01-24T21:00 that broke it.
Comment #1 by monarchdodra — 2014-01-25T08:45:29Z
Comment #2 by k.hara.pg — 2014-01-25T09:04:13Z
*** Issue 11994 has been marked as a duplicate of this issue. ***
Comment #3 by k.hara.pg — 2014-01-25T09:07:01Z
(In reply to comment #1) > https://github.com/D-Programming-Language/dmd/pull/3103 > > Might be responsible for this. In 2.064 and earlier, there was nasty bug. 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 } When I opened #3103, I didn't know the bug, and to pass existing dmd test case (test/runnable/opover2.d test15()), I was wrongly changed the behavior.
Comment #4 by k.hara.pg — 2014-01-25T09:09:52Z
I change the summary to express the bug more precise that was in 2.064 and earlier.
Comment #5 by k.hara.pg — 2014-01-25T09:11:43Z
Comment #6 by github-bugzilla — 2014-01-25T15:19:56Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/798c0c0178dec61c66292b6f7c904b19c396fee2 fix Issue 11993 - typeof(this) in constraint of member function template should reflect method qualifier https://github.com/D-Programming-Language/dmd/commit/5c6a973c7182d5248697de5e97550e4e3cfb8065 Merge pull request #3151 from 9rnsr/fix11993 [REG] Issue 11993 - typeof(this) in constraint of member function template should reflect method qualifier
Comment #7 by github-bugzilla — 2014-01-27T16:24:05Z
Commit pushed to 2.065 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/68a24a29d06b8dc35de1ca8380318320c95793d4 Merge pull request #3151 from 9rnsr/fix11993 [REG] Issue 11993 - typeof(this) in constraint of member function template should reflect method qualifier
Comment #8 by github-bugzilla — 2014-01-27T17:47:37Z
Commit pushed to 2.065 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/d5d704a96109931bf0f0ff21a963456feab3e40a Merge pull request #3151 from 9rnsr/fix11993 [REG] Issue 11993 - typeof(this) in constraint of member function template should reflect method qualifier
Comment #9 by github-bugzilla — 2014-01-27T19:24:47Z
Commit pushed to 2.065 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/b2baac2aad179060487dead30d1a799f8ee64eaf Merge pull request #3151 from 9rnsr/fix11993 [REG] Issue 11993 - typeof(this) in constraint of member function template should reflect method qualifier