[LLVMbugs] [Bug 15463] New: Accepts invalid function with external linkage and type with no linkage

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Mar 6 19:13:26 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=15463

            Bug ID: 15463
           Summary: Accepts invalid function with external linkage and
                    type with no linkage
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: rafael.espindola at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The c++ standard says:

A type without linkage shall not be used as the type of a variable or function
with external linkage unless
— the entity has C language linkage (7.5), or
— the entity is declared within an unnamed namespace (7.3.1), or
— the entity is not odr-used (3.2) or is defined in the same translation unit.

but we accept

typedef struct {
  void *foo() { return 0; }
} *A;
void test(A a);
void zed() {
  test(0);
}

-- 
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/20130307/6beceb8a/attachment.html>


More information about the llvm-bugs mailing list