LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 21866 - [fuzz] Assertion `Pos != Map->end() && "no lookup entry for decl"' failed.
Summary: [fuzz] Assertion `Pos != Map->end() && "no lookup entry for decl"' failed.
Status: RESOLVED FIXED
Alias: None
Product: clang
Classification: Unclassified
Component: -New Bugs (show other bugs)
Version: trunk
Hardware: PC Linux
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks: 23057
  Show dependency tree
 
Reported: 2014-12-10 16:14 PST by Sami Liedes
Modified: 2019-02-21 14:12 PST (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments
test case (137 bytes, text/x-c++src)
2014-12-10 16:14 PST, Sami Liedes
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sami Liedes 2014-12-10 16:14:21 PST
Created attachment 13507 [details]
test case

Fuzzing discovered that the attached test case, when given as input to

  clang -fno-crash-diagnostics -std=c++11 -xc++ -c -emit-llvm

causes this assertion failure:

clang-3.6: tools/clang/lib/AST/DeclBase.cpp:1162: void clang::DeclContext::removeDecl(clang::Decl *): Assertion `Pos != Map->end() && "no lookup entry for decl"' failed.
Comment 1 Reid Kleckner 2019-02-21 14:12:14 PST
Does not crash anymore:

$ clang --target=x86_64-linux -c -std=c++11 no-lookup-entry.cpp
no-lookup-entry.cpp:4:46: error: template specialization or definition requires a template parameter list corresponding to the nested type 'S<A>'
template<typename A> template<( struct S<A>::T {};
                                             ^
no-lookup-entry.cpp:4:46: error: 'T' cannot be defined in a parameter type
no-lookup-entry.cpp:4:50: error: expected ')'
template<typename A> template<( struct S<A>::T {};
                                                 ^
no-lookup-entry.cpp:4:31: note: to match this '('
template<typename A> template<( struct S<A>::T {};
                              ^
no-lookup-entry.cpp:4:50: error: expected template parameter
template<typename A> template<( struct S<A>::T {};
                                                 ^
no-lookup-entry.cpp:4:50: error: expected ',' or '>' in template-parameter-list
no-lookup-entry.cpp:4:50: warning: declaration does not declare anything [-Wmissing-declarations]
no-lookup-entry.cpp:5:18: error: expected '}'
static void g() {
                 ^
no-lookup-entry.cpp:5:17: note: to match this '{'
static void g() {
                ^
1 warning and 6 errors generated.