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

Reply via email to