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

             Bug #: 12331
           Summary: assertion on explicit specialization after
                    instantiation
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: crash-on-invalid
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


Clang asserts on this:

template<typename T> struct S {
  struct U { static const int n = 5; };
  enum E { e = U::n };
  int arr[e];
};
template<> struct S<int>::U { static const int n = sizeof(T); };


Saying:

error: explicit specialization of 'U' after instantiation
template<> struct S<int>::U { static const int n = sizeof(T); };
                          ^
note: implicit instantiation first required here
  enum E { e = U::n };
               ^
clang-3.1: lib/Sema/SemaLookup.cpp:1418: bool
clang::Sema::LookupQualifiedName(clang::LookupResult &, clang::DeclContext *,
bool): Assertion `(!isa<TagDecl>(LookupCtx) || LookupCtx->isDependentContext()
|| cast<TagDecl>(LookupCtx)->isCompleteDefinition() ||
Context.getTypeDeclType(cast<TagDecl>(LookupCtx))->getAs<TagType>()
->isBeingDefined()) && "Declaration context must already be complete!"' failed.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- 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