[llvm-bugs] [Bug 25561] New: Clang assertion failure on template instantiation

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Nov 17 15:13:48 PST 2015


https://llvm.org/bugs/show_bug.cgi?id=25561

            Bug ID: 25561
           Summary: Clang assertion failure on template instantiation
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: rtrieu at google.com
                CC: ismail.pazarbasi at gmail.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

In clang::Sema::ActOnExplicitInstantiation in lib/Sema/SemaTemplate.cpp:7259,
Clang hits an assertion when attempting to cast a TemplateDecl to a
ClassTemplateDecl.

7259:   ClassTemplateDecl *ClassTemplate = cast<ClassTemplateDecl>(TD);

test.cc:
class A {};
template <template <typename> class B>
class C {
  template class B<A>;
};

clang -cc1 test.cc
clang: ../include/llvm/Support/Casting.h:237: typename cast_retty<X, Y
*>::ret_type llvm::cast(Y *) [X = clang::ClassTemplateDecl, Y =
clang::TemplateDecl]: Assertion `isa<X>(Val) && "cast<Ty>() argument of
incompatible type!"' failed.
...
Stack dump:
0.    Program arguments: clang -cc1 test.cc 
1.    test.cc:4:22: current parser token ';'
2.    test.cc:3:1: parsing struct/union/class body 'C'
Aborted (core dumped)

-- 
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/20151117/b5c6eaa6/attachment-0001.html>


More information about the llvm-bugs mailing list