Bug 7680 – template specialization bug

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-03-10T12:32:24Z
Last change time
2024-12-13T17:58:59Z
Keywords
accepts-invalid
Assigned to
No Owner
Creator
Martin Nowak
Moved to GitHub: dmd#18424 →

Comments

Comment #0 by code — 2012-03-10T12:32:24Z
cat > bug.d << CODE struct Bar(T) {} template Foo26(T:Bar!(const T)) { pragma(msg, "const", T); } template Foo26(T:Bar!(T)) { pragma(msg, "mod", T); } void main() { alias Foo26!(Bar!int) foo; } CODE dmd -c bug -------- I'm not sure whether Bar!int should match Bar!(const T) in the first place. However if it does it must be a MATCHconst.
Comment #1 by nick — 2023-02-28T18:20:32Z
The error is: > tempspecconst.d(14): Error: template `tempspecconst.Foo26` matches more than one template declaration: > I'm not sure whether Bar!int should match Bar!(const T) in the first place. Well this fails so I'd say no: Bar!int b; Bar!(const int) c = b;
Comment #2 by nick — 2023-02-28T18:24:53Z
With only the top overload present, the code compiles even though the argument is `Bar!int`, not `Bar!(const int)`: > template Foo26(T:Bar!(const T))
Comment #3 by robert.schadek — 2024-12-13T17:58:59Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18424 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB