http://llvm.org/bugs/show_bug.cgi?id=16247
Bug ID: 16247
Summary: Assertion failure computing linkage with overload of
extern "C" function
Product: clang
Version: unspecified
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected]
Classification: Unclassified
Assertion failed: (!isa<NamedDecl>(static_cast<decl_type*>(this)) ||
cast<NamedDecl>(static_cast<decl_type*>(this))->isLinkageValid()), function
setPreviousDeclaration, file
/Volumes/storage/llvm/tools/clang/lib/AST/../../include/clang/AST/Decl.h, line
3402.
Testcase:
extern "C" void foo(int);
static void foo(double);
void foo(int) { }
void foo(double) {}
It looks like Sema::IsOverload forces the linkage of foo(double) to be computed
before we hook up the declaration chain, which leads to the assertion.
I'm pretty sure this is not well-formed ([dcl.link]p6 says "At most one
function with a particular name can have C language linkage.").
Rafael, this is code you've been working on relatively recently; any thoughts?
(This is also <rdar://problem/14073466>.)
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs