Skip to content

Assertion `ResultKind != Found || Decls.size() == 1' on invalid code #9833

@llvmbot

Description

@llvmbot
Bugzilla Link 9461
Resolution FIXED
Resolved on Apr 21, 2011 20:28
Version trunk
OS All
Attachments Asserting testcase
Reporter LLVM Bugzilla Contributor
CC @akyrtzi,@DougGregor,@efriedma-quic,@tkremenek

Extended Description

The attached code (apologises for it's size, it came from a fuzzer and I could not reduce it further) produces the following backtrace:

assert3.cc:19:1: error: C++ requires a type specifier for all declarations
_S_construct();
^~~~~~~~~~~~
assert3.cc:30:29: error: expected '}'
system_error():time_error(""
^
assert3.cc:29:34: note: to match this '{'
struct system_error:runtime_error{
^
assert3.cc:30:29: error: expected ')'
system_error():time_error(""
^
assert3.cc:30:26: note: to match this '('
system_error():time_error(""
^
assert3.cc:30:16: error: initializer 'time_error' does not name a non-static data member or base class; did you mean the base class 'runtime_error'?
system_error():time_error(""
^~~~~~~~~~
runtime_error
assert3.cc:29:21: note: base class 'runtime_error' specified here
struct system_error:runtime_error{
^~~~~~~~~~~~~
assert3.cc:30:29: error: expected '{' or ','
system_error():time_error(""
^
assert3.cc:30:29: error: expected ';' after struct
system_error():time_error(""
^
;
clang: SemaLookup.cpp:301: void clang::LookupResult::sanity() const: Assertion `ResultKind != Found || Decls.size() == 1' failed.
0 clang 0x00000000023fb09d
1 clang 0x00000000023fae90
2 libpthread.so.0 0x00007f28c22248f0
3 libc.so.6 0x00007f28c1513a75 gsignal + 53
4 libc.so.6 0x00007f28c15175c0 abort + 384
5 libc.so.6 0x00007f28c150c941 __assert_fail + 241
6 clang 0x0000000001435d38 clang::LookupResult::sanity() const + 136
7 clang 0x0000000001301ea8 clang::LookupResult::getResultKind() const + 24
8 clang 0x0000000001301e88 clang::LookupResult::isAmbiguous() const + 24
9 clang 0x0000000001301f60 clang::LookupResult::diagnose() + 24
10 clang 0x0000000001301e41 clang::LookupResult::~LookupResult() + 39
11 clang 0x000000000152a319
12 clang 0x0000000001519f57
13 clang 0x000000000151a714
14 clang 0x0000000001515b8a clang::Sema::SubstExprs(clang::Expr**, unsigned int, bool, clang::MultiLevelTemplateArgumentList const&, llvm::SmallVectorImplclang::Expr*&) + 142
15 clang 0x000000000153936c
16 clang 0x000000000154224a clang::Sema::InstantiateMemInitializers(clang::CXXConstructorDecl*, clang::CXXConstructorDecl const*, clang::MultiLevelTemplateArgumentList const&) + 1250
17 clang 0x000000000154164c clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool) + 1710
18 clang 0x0000000001543adb clang::Sema::PerformPendingInstantiations(bool) + 341
19 clang 0x00000000012f11e4 clang::Sema::ActOnEndOfTranslationUnit() + 376
20 clang 0x00000000012b1007 clang::Parser::ParseTopLevelDecl(clang::OpaquePtrclang::DeclGroupRef&) + 119
21 clang 0x0000000001299705 clang::ParseAST(clang::Sema&, bool) + 328
22 clang 0x00000000010015c1 clang::ASTFrontendAction::ExecuteAction() + 263
23 clang 0x000000000113bfaf clang::CodeGenAction::ExecuteAction() + 947
24 clang 0x0000000001001212 clang::FrontendAction::Execute() + 320
25 clang 0x0000000000fe9ec9 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 751
26 clang 0x0000000000f93583 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 912
27 clang 0x0000000000f855c7 cc1_main(char const**, char const**, char const*, void*) + 982
28 clang 0x0000000000f8ea3c main + 499
29 libc.so.6 0x00007f28c14fec4d __libc_start_main + 253
30 clang 0x0000000000f84c69
Stack dump:
0. Program arguments: /llvmdebug/bin/clang -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name assert3.cc -mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version 2.20.1 -momit-leaf-frame-pointer -resource-dir /llvmdebug/bin/../lib/clang/3.0 -ferror-limit 19 -fmessage-length 195 -fcxx-exceptions -fexceptions -fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics -o assert3.o -x c++ assert3.cc

  1.  <eof> parser at end of file
    
  2.  assert3.cc:13:1: instantiating function definition 'basic_string'
    

clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal 1 (use -v to see invocation)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions