overloaded extern(C) called without error

David Nadlinger code at klickverbot.at
Tue Sep 10 09:41:13 PDT 2013


On Tuesday, 10 September 2013 at 14:04:58 UTC, Luís Marques wrote:
>     extern(C) void foo(int);
>     extern(C) void foo() {}

I agree that this should not be legal. LDC detects this in the 
glue layer (we would have to add a workaround for the 
corresponding LLVM restriction otherwise):

---
$ ldc2 test.d
test.d(4): Error: Function type does not match previously 
declared function with the same mangled name: foo
---

David


More information about the Digitalmars-d mailing list