[LLVMbugs] [Bug 16247] New: Assertion failure computing linkage with overload of extern "C" function

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jun 6 13:57:35 PDT 2013


            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: unassignedclangbugs at nondot.org
          Reporter: sharparrow1 at yahoo.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu,
                    rafael.espindola at gmail.com
    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

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130606/0a97526b/attachment.html>

More information about the llvm-bugs mailing list