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 28500 - Assertion failed: isa<LabelDecl>(D) && "declaration not instantiated in this scope"
Summary: Assertion failed: isa<LabelDecl>(D) && "declaration not instantiated in this ...
Status: CONFIRMED
Alias: None
Product: clang
Classification: Unclassified
Component: Frontend (show other bugs)
Version: 3.8
Hardware: Other Linux
: P normal
Assignee: Mark de Wever
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-11 10:41 PDT by jtony
Modified: 2019-08-03 02:16 PDT (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jtony 2016-07-11 10:41:41 PDT
Steps to reproduce on linux:
-bash-4.2$ cat r.cpp
template <class T> void bar(T t = [](decltype(t) i){return 0;}(0)) {}
void foo()
{
  bar<int>();
}
-bash-4.2$ pwd
/home/jtony/workitems/132592
-bash-4.2$ cat r.cpp
template <class T> void bar(T t = [](decltype(t) i){return 0;}(0)) {}
void foo()
{
  bar<int>();
}


bash-4.2$ myclang++ r.cpp  -std=c++11
clang: /home/jtony/build/3_8/llvm-dev.src/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp:2811: llvm::PointerUnion<clang::Decl*, llvm::Smal
lVector<clang::ParmVarDecl*, 4u>*>* clang::LocalInstantiationScope::findInstantiationOf(const clang::Decl*): Assertion `isa<LabelDecl>(D) &&
 "declaration not instantiated in this scope"' failed.
0  clang     0x000000001568c4e4 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 68
...
clang version 3.8.0 (tags/RELEASE_380/final)
Target: powerpc64le-unknown-linux-gnu
Thread model: posix


-bash-4.2$ type myclang
myclang is aliased to `/home/jtony/build/runnable/bin/clang'
Comment 1 Mark de Wever 2019-08-03 02:16:39 PDT
I proposed a fix https://reviews.llvm.org/D65694