Hi,
The following test case crashes in different places depending on whether or not -femit-all-decls is passed
on the command-line. I am thinking that moving the err_duplicate_mangled_name diagnostic from
EmitGlobalFunctionDefinition() into EmitGlobal() should fix the issue.
$ clang -S -emit-llvm -o - test.cpp
$ clang -S -femit-all-decls -emit-llvm -o - test.cpp
// test.cpp
extern "C" int printf(const char *, ...);
void foo(void) __asm("_ZN1SC2Ev");
void foo(void) { }
struct S {
S() { printf("S constructor\n"); };
} var;
// end test.cpp
What do you think?
- Gao