[LLVMbugs] [Bug 13023] New: Assertion `Proto && "Functions without a prototype cannot be overloaded"' failed
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Mon Jun 4 11:17:52 PDT 2012
http://llvm.org/bugs/show_bug.cgi?id=13023
Bug #: 13023
Summary: Assertion `Proto && "Functions without a prototype
cannot be overloaded"' failed
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: merkil at savhon.org
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
Fails with clang 3.1 and trunk as of r157903.
$ cat file.c
f();
uint8_t f()
{
f();
}
$ clang file.c
file.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
f();
^
file.c:3:1: error: unknown type name 'uint8_t'
uint8_t f()
^
clang: /home/merkil/git/clang/llvm/tools/clang/lib/Sema/SemaOverload.cpp:5228:
void clang::Sema::AddOverloadCandidate(clang::FunctionDecl *,
clang::DeclAccessPair, llvm::ArrayRef<Expr *>, clang::OverloadCandidateSet &,
bool, bool, bool): Assertion `Proto && "Functions without a prototype cannot be
overloaded"' failed.
0 clang 0x0000000001bb22af
1 clang 0x0000000001bb27c4
2 libpthread.so.0 0x00007f549646f280
3 libc.so.6 0x00007f54956db5a5 gsignal + 53
4 libc.so.6 0x00007f54956dc84a abort + 378
5 libc.so.6 0x00007f54956d47ce
6 libc.so.6 0x00007f54956d4890 __assert_perror_fail + 0
7 clang 0x0000000000af37fb
clang::Sema::AddOverloadCandidate(clang::FunctionDecl*, clang::DeclAccessPair,
llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool, bool, bool) +
603
8 clang 0x0000000000afea43
9 clang 0x0000000000afe819
clang::Sema::AddOverloadedCallCandidates(clang::UnresolvedLookupExpr*,
llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool) + 537
10 clang 0x0000000000afecf2
clang::Sema::BuildOverloadedCallExpr(clang::Scope*, clang::Expr*,
clang::UnresolvedLookupExpr*, clang::SourceLocation, clang::Expr**, unsigned
int, clang::SourceLocation, clang::Expr*, bool) + 674
11 clang 0x0000000000a2a22b clang::Sema::ActOnCallExpr(clang::Scope*,
clang::Expr*, clang::SourceLocation, clang::ASTMultiPtr<clang::Expr*>,
clang::SourceLocation, clang::Expr*, bool) + 1099
12 clang 0x00000000008dbf0a
clang::Parser::ParsePostfixExpressionSuffix(clang::ActionResult<clang::Expr*,
true>) + 2570
13 clang 0x00000000008ddd5b clang::Parser::ParseCastExpression(bool,
bool, bool&, clang::Parser::TypeCastState) + 6091
14 clang 0x00000000008d9f24
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) + 132
15 clang 0x00000000008d9e89
clang::Parser::ParseExpression(clang::Parser::TypeCastState) + 9
16 clang 0x0000000000900a28 clang::Parser::ParseExprStatement() + 56
17 clang 0x00000000009005bf
clang::Parser::ParseStatementOrDeclarationAfterAttributes(clang::ASTOwningVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&)
+ 2239
18 clang 0x00000000008ffc5b
clang::Parser::ParseStatementOrDeclaration(clang::ASTOwningVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*) + 155
19 clang 0x00000000009061ff
clang::Parser::ParseCompoundStatementBody(bool) + 1391
20 clang 0x0000000000907aee
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 174
21 clang 0x00000000008b3482
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&,
llvm::SmallVector<clang::Parser::LateParsedAttribute*, 2u>*) + 1826
22 clang 0x00000000008bf236
clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned int, bool,
clang::SourceLocation*, clang::Parser::ForRangeInit*) + 1558
23 clang 0x00000000008b2845
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsingDeclSpec&,
clang::AccessSpecifier) + 517
24 clang 0x00000000008b2a85
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&,
clang::AccessSpecifier) + 357
25 clang 0x00000000008b1eac
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 2364
26 clang 0x00000000008b14f0
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 304
27 clang 0x00000000008adccb clang::ParseAST(clang::Sema&, bool, bool)
+ 283
28 clang 0x0000000000783a78 clang::CodeGenAction::ExecuteAction() +
184
29 clang 0x000000000065270d
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 973
30 clang 0x000000000063b0ab
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3307
31 clang 0x000000000063038b cc1_main(char const**, char const**, char
const*, void*) + 731
32 clang 0x000000000063772a main + 3482
33 libc.so.6 0x00007f54956c84bd __libc_start_main + 253
34 clang 0x000000000062ffed
Stack dump:
0. Program arguments: /home/merkil/git/clang/build/Release+Asserts/bin/clang
-cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-main-file-name file.c -mrelocation-model static -mdisable-fp-elim -fmath-errno
-masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64
-target-linker-version 2.22 -momit-leaf-frame-pointer -resource-dir
/home/merkil/git/clang/build/Release+Asserts/bin/../lib/clang/3.2
-fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem
/usr/local/include -internal-isystem
/home/merkil/git/clang/build/Release+Asserts/bin/../lib/clang/3.2/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdebug-compilation-dir /home/merkil -ferror-limit 19 -fmessage-length 169
-mstackrealign -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak
-fobjc-fragile-abi -fdiagnostics-show-option -fcolor-diagnostics -o
/tmp/file-XIMLYA.o -x c file.c
1. file.c:5:7: current parser token ')'
2. file.c:4:1: parsing function body 'f'
3. file.c:4:1: in compound statement ('{}')
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang: note: diagnostic msg: Please submit a bug report to
http://llvm.org/bugs/ and include command line arguments and all diagnostic
information.
clang version 3.2 (trunk 157903)
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang: note: diagnostic msg: Preprocessed source(s) and associated run
script(s) are located at:
clang: note: diagnostic msg: /tmp/file-wFFfGU.i
clang: note: diagnostic msg: /tmp/file-wFFfGU.sh
--
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