Bug 895 – multiply defined function via alias isn't failing to build
Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2007-01-27T02:05:00Z
Last change time
2014-02-15T13:12:30Z
Keywords
accepts-invalid
Assigned to
bugzilla
Creator
braddr
Comments
Comment #0 by braddr — 2007-01-27T02:05:21Z
// $HeadURL: http://dstress.kuehne.cn/nocompile/alias_05.d $
// $Date: 2005-12-03 23:19:07 +0100 (Sat, 03 Dec 2005) $
// $Author: thomask $
// __DSTRESS_ELINE__ 14
module dstress.nocompile.alias_05;
alias int myint;
void foo(int x) {
}
void foo(myint m) { // error, multiply defined function foo
}
The compiler phase doesn't fail, though the linker does (at least on linux, haven't tested windows). Since alias' are supposed to be weak and type-invisible, this should be an error, no?
Comment #1 by bugzilla — 2007-01-28T16:44:27Z
It gives a link error on Windows, too. While it would be nice if the compiler issued the error, an error is still generated at build time. Moved to enhancement.
Comment #2 by yebblies — 2012-01-31T20:13:12Z
*** This issue has been marked as a duplicate of issue 656 ***
Comment #3 by yebblies — 2012-02-14T19:37:33Z
Wrong bug number
*** This issue has been marked as a duplicate of issue 2789 ***