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'
I proposed a fix https://reviews.llvm.org/D65694