[Issue 3684] New: Segmentation fault on wrong template instantiation syntax with typeof
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Jan 7 03:17:06 PST 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3684
Summary: Segmentation fault on wrong template instantiation
syntax with typeof
Product: D
Version: 2.038
Platform: Other
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bugzilla at kyllingen.net
--- Comment #0 from Lars T. Kyllingstad <bugzilla at kyllingen.net> 2010-01-07 03:17:05 PST ---
The following (incorrect) code causes DMD to segfault on compilation:
template Foo(T) if (is(T == int))
{
enum bool Foo = true;
}
template Foo(T) if (!is(T == int))
{
enum bool Foo = Foo(typeof(int.min));
}
static assert (Foo!double);
In the second template, note the following two things which are BOTH required
to reproduce the bug:
1) The ! is missing from the template instantiation.
2) The template parameter is typeof(int.min) instead of just int.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list