[LLVMbugs] [Bug 17194] New: Use of undefined local struct triggers assertion in SemaTemplateInstantiate.cpp

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Sep 11 08:32:56 PDT 2013


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

            Bug ID: 17194
           Summary: Use of undefined local struct triggers assertion in
                    SemaTemplateInstantiate.cpp
           Product: clang
           Version: 3.3
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: m.krause at tu-harburg.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Trying to compile the following with clang SVN trunk 190512 (also tried
clang-3.3, same result) triggers an assertion in
SemaTemplateInstantiate.cpp:2758: 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.

--- SNIP ---

template <class U>
class B {};

template <typename T>
void g() {
    B<struct X> b;
}

void f() {
    g<double>();
}

--- SNIP ---

The assertion is NOT triggered, for example, when I replace g() with the
following version:

void g() {
    struct X;
    B<X> b;
}

Command line was simply 'clang++ -std=c++11 crash.cpp'.

This might be related to bug #9685, but I'm not sure.

-- 
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/20130911/d9daf07a/attachment.html>


More information about the llvm-bugs mailing list