[LLVMbugs] [Bug 12812] New: Error recovery can trigger Assertion `Proto && "Functions without a prototype cannot be overloaded"'

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun May 13 20:43:50 PDT 2012


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

             Bug #: 12812
           Summary: Error recovery can trigger Assertion `Proto &&
                    "Functions without a prototype cannot be overloaded"'
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: hfinkel at anl.gov
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 8545
  --> http://llvm.org/bugs/attachment.cgi?id=8545
reduced test case (provided by Craig Schroeder)

Running clang trunk on this C code:

k(0);k(a==8);int bar(){k(0);}

results in:

t7.c:1:3: error: expected parameter declarator
k(0);k(a==8);int bar(){k(0);}
  ^
t7.c:1:3: error: expected ')'
t7.c:1:2: note: to match this '('
k(0);k(a==8);int bar(){k(0);}
 ^
t7.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
k(0);k(a==8);int bar(){k(0);}
^
t7.c:1:8: error: unknown type name 'a'
k(0);k(a==8);int bar(){k(0);}
       ^
t7.c:1:9: error: expected ')'
k(0);k(a==8);int bar(){k(0);}
        ^
t7.c:1:7: note: to match this '('
k(0);k(a==8);int bar(){k(0);}
      ^
t7.c:1:6: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
k(0);k(a==8);int bar(){k(0);}
     ^
clang: /src/llvm-trunk-writable/tools/clang/lib/Sema/SemaOverload.cpp:5228:
void clang::Sema::AddOverloadCandidate(clang::FunctionDecl*,
clang::DeclAccessPair, llvm::ArrayRef<clang::Expr*>,
clang::OverloadCandidateSet&, bool, bool, bool): Assertion `Proto && "Functions
without a prototype cannot be overloaded"' failed.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list