[LLVMbugs] [Bug 18806] New: Precompiled header with alias template and decltype in a template class crash clang

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Feb 11 08:46:10 PST 2014


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

            Bug ID: 18806
           Summary: Precompiled header with alias template and decltype in
                    a template class crash clang
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: st at quanttec.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Compiling the two simple files below with 

clang++ -std=c++11 -x c++-header -o test.hpp.pch test.hpp
clang++ -std=c++11 -include-pch test.hpp.pch -include test.hpp test.cpp

triggers a crash caused by the following assert error

llvm/tools/clang/lib/AST/ASTContext.cpp:3046: clang::QualType
clang::ASTContext::getSubstTemplateTypeParmType(const
clang::TemplateTypeParmType*, clang::QualType) const: Assertion
`Replacement.isCanonical() && "replacement types must always be canonical"'
failed.

-- test.hpp --
template <typename T>
using Id = T;

template <typename X>
struct Class1 {
private:
  template <typename Y,            
            typename = decltype(Y())>
  struct Nested1;
};

template <typename A>
struct Class2 {
  template <typename B,            
            typename = Id<decltype(B())>>
  struct Nested2;
};

-- test.cpp --
Class2<char> test;

-- 
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/20140211/38bd0096/attachment.html>


More information about the llvm-bugs mailing list