Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Error recovery can trigger Assertion `Proto && "Functions without a prototype cannot be overloaded"' #12917

Open Quuxplusone opened 12 years ago

Quuxplusone commented 12 years ago
Bugzilla Link PR12812
Status NEW
Importance P normal
Reported by Hal Finkel (hfinkel@anl.gov)
Reported on 2012-05-13 22:43:50 -0700
Last modified on 2012-05-13 22:44:06 -0700
Version trunk
Hardware PC Linux
CC dgregor@apple.com, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments t7.c (31 bytes, text/x-csrc)
Blocks
Blocked by
See also
Created attachment 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.
Quuxplusone commented 12 years ago

Attached t7.c (31 bytes, text/x-csrc): reduced test case (provided by Craig Schroeder)