Bug 7862 – Accepts-invalid template forward reference bug related to derivedMembers

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-04-08T15:13:00Z
Last change time
2012-04-08T17:36:08Z
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2012-04-08T15:13:00Z
This code compiles using DMD e0cdcac, but failed as expected using DMD 2.058: --- template B(T) { mixin( { foreach (name; __traits(derivedMembers, T)) {} return "struct B {}"; }() ); } struct A { pragma(msg, "A: ", __traits(compiles, B!(typeof(this)))); B!(typeof(this)) c; static if (nonExistent!()) {} } auto d = A.init.c; --- (output is »A: false«, but apparently the template can be instantiated afterwards)
Comment #1 by github-bugzilla — 2012-04-08T17:35:38Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/d16cfe5047dc1a1768dbf216414d55b920341112 fix Issue 7862 - Accepts-invalid template forward reference bug related to derivedMembers