Bug 15063 – Template Instantiation Accepts Invalid Code

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-09-15T19:33:18Z
Last change time
2024-12-13T18:44:43Z
Keywords
accepts-invalid
Assigned to
No Owner
Creator
Jack Stouffer
Moved to GitHub: dmd#19042 →

Comments

Comment #0 by jack — 2015-09-15T19:33:18Z
The following code should not compile, as the call to test1 matches both overloads. import std.typecons : Flag; void test1(alias pred="a == b", T)(T a) {} alias SomeFlag = Flag!"SomeFlag"; void test1(SomeFlag allocate_gc = SomeFlag.no, T)(T a) {} void main() { test1(1); }
Comment #1 by k.hara.pg — 2015-09-16T00:39:55Z
Reduced test case: void test1(alias pred = "a == b", T)(T a) { pragma(msg, 1); } void test1(int flag = 0, T)(T a) { pragma(msg, 2); } void main() { test1(1); }
Comment #2 by robert.schadek — 2024-12-13T18:44:43Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19042 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB