Bug 4110 – Function template with two constraints

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
tools
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2010-04-21T13:53:00Z
Last change time
2015-06-09T05:13:45Z
Keywords
accepts-invalid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2010-04-21T13:53:21Z
This D2 code is wrong: void foo(T)(T x) if (is(T == int)) { if (!is(T == float)) { } void main() { foo(1); } The dmd 2.043 compiler+linker spit out: OPTLINK (R) for Win32 Release 8.00.2 Copyright (C) Digital Mars 1989-2009 All rights reserved. http://www.digitalmars.com/ctg/optlink.html OPTLINK : Warning 23: No Stack OPTLINK : Warning 134: No Start Address
Comment #1 by gide — 2010-04-24T02:41:46Z
You missed out a brace, patch in BUG 4084 should prevent this from compiling. *** This issue has been marked as a duplicate of issue 4084 ***