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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to