[LLVMbugs] [Bug 16225] New: Assert-on-invalid: isa<LabelDecl>(D) && "declaration not instantiated in this scope"

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jun 4 10:24:53 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=16225

            Bug ID: 16225
           Summary: Assert-on-invalid: isa<LabelDecl>(D) && "declaration
                    not instantiated in this scope"
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: hans at chromium.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

$ cat a.cc
template <typename T> void f();

template<typename C> void g(C*) {
  struct LocalStruct : UnkonwnBase<Mumble, C> { };
  f<LocalStruct>();
}

struct S;
void h() {
  g<S>(0);
}

$ clang -c a.cc
a.cc:4:24: error: unknown template name 'UnkonwnBase'
  struct LocalStruct : UnkonwnBase<Mumble, C> { };
                       ^
a.cc:4:45: error: expected '{' after base class list
  struct LocalStruct : UnkonwnBase<Mumble, C> { };
                                            ^
a.cc:4:45: error: expected unqualified-id
clang: SemaTemplateInstantiate.cpp:2694: llvm::PointerUnion<clang::Decl*,
llvm::SmallVector<clang::Decl*, 4u>*>*
clang::LocalInstantiationScope::findInstantiationOf(const clang::Decl*):
Assertion `isa<LabelDecl>(D) && "declaration not instantiated in this scope"'
failed.
0  clang           0x000000000247d572 llvm::sys::PrintStackTrace(_IO_FILE*) +
34
1  clang           0x000000000247c999
2  libpthread.so.0 0x00007f0820ab0cb0
3  libc.so.6       0x00007f081fd02425 gsignal + 53
4  libc.so.6       0x00007f081fd05b8b abort + 379
5  libc.so.6       0x00007f081fcfb0ee
6  libc.so.6       0x00007f081fcfb192
7  clang           0x0000000000e0b0ff
8  clang           0x0000000000e400e8
clang::Sema::FindInstantiatedDecl(clang::SourceLocation, clang::NamedDecl*,
clang::MultiLevelTemplateArgumentList const&) + 488
9  clang           0x0000000000e095c6
10 clang           0x0000000000e09b87
11 clang           0x0000000000e12535
12 clang           0x0000000000e14482
13 clang           0x0000000000e16324
14 clang           0x0000000000e17918
15 clang           0x0000000000e1cc98
16 clang           0x0000000000e1d8b7
17 clang           0x0000000000e27296
18 clang           0x0000000000e27436
19 clang           0x0000000000e1d86e
20 clang           0x0000000000e2d5c9
21 clang           0x0000000000e2ed01
22 clang           0x0000000000e2d135
23 clang           0x0000000000e2f8ef clang::Sema::SubstStmt(clang::Stmt*,
clang::MultiLevelTemplateArgumentList const&) + 79
24 clang           0x0000000000e4a195
clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation,
clang::FunctionDecl*, bool, bool) + 1989
25 clang           0x0000000000e496b1
clang::Sema::PerformPendingInstantiations(bool) + 657
26 clang           0x0000000000b340a2 clang::Sema::ActOnEndOfTranslationUnit()
+ 466
27 clang           0x0000000000a99036
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 374
28 clang           0x0000000000a923cd clang::ParseAST(clang::Sema&, bool, bool)
+ 493
29 clang           0x000000000076d9ca clang::FrontendAction::Execute() + 282
30 clang           0x0000000000751200
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 352
31 clang           0x0000000000737602
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1714
32 clang           0x000000000072ff90 cc1_main(char const**, char const**, char
const*, void*) + 1264
33 clang           0x0000000000713ea3 main + 787
34 libc.so.6       0x00007f081fced76d __libc_start_main + 237
35 clang           0x000000000072f92d
Stack dump:
0.    Program arguments: /usr/local/google/work/llvm/Release+Asserts/bin/clang
-cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-main-file-name a.cc -mrelocation-model static -mdisable-fp-elim -fmath-errno
-masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64
-target-linker-version 2.22 -coverage-file /tmp/a.o -resource-dir
/usr/local/google/work/llvm/Release+Asserts/bin/../lib/clang/3.4
-internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/x86_64-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/backward
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/x86_64-linux-gnu/c++/4.6
-internal-isystem /usr/local/include -internal-isystem
/usr/local/google/work/llvm/Release+Asserts/bin/../lib/clang/3.4/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdeprecated-macro -fdebug-compilation-dir /tmp -ferror-limit 19
-fmessage-length 165 -mstackrealign -fobjc-runtime=gcc
-fobjc-default-synthesize-properties -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -backend-option -vectorize-loops
-o a.o -x c++ a.cc 
1.    <eof> parser at end of file
2.    a.cc:3:27: instantiating function definition 'g'
clang: error: unable to execute command: Aborted (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.4 (trunk 183101) (llvm/trunk 183104)
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/a/HKKO7h.cpp
clang: note: diagnostic msg: /tmp/a/HKKO7h.sh
clang: note: diagnostic msg: 

********************

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130604/ac150d20/attachment.html>


More information about the llvm-bugs mailing list