← Back to index
|
Original Bugzilla link
Bug 16399 – template with func. ptr. argument and anon. func. in the template body, rejects its argument
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-08-17T14:24:32Z
Last change time
2022-11-10T12:49:03Z
Assigned to
No Owner
Creator
Cauterite
Comments
Comment #0
by cauterite — 2016-08-17T14:24:32Z
(
https://dpaste.dzfl.pl/79301f12e5fc
) // ------ Example: ---------- template A(alias Arg) { enum A = Arg; enum Unrelated = ({return 0;})(); // Error: expression & asdf is not a valid template value argument }; void main() { enum FnPtr = &asdf; enum _ = A!FnPtr; }; void asdf() {}; // ------------------ remove the "enum Unrelated =" line and it compiles fine. this also compiles fine:
https://dpaste.dzfl.pl/fca15065a4cf
Comment #1
by razvan.nitu1305 — 2022-11-10T12:49:03Z
I cannot reproduce this with the latest version of master.