[LLVMbugs] [Bug 14266] New: Problem with PCH serialization and friend template specializations

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Nov 5 16:45:26 PST 2012


             Bug #: 14266
           Summary: Problem with PCH serialization and friend template
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: ripzonetriton at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 9497
  --> http://llvm.org/bugs/attachment.cgi?id=9497

Clang asserts when trying to compile a file using a previously generated PCH.

Assertion failed: (!Canon.isNull() || T.isDependent() ||
anyDependentTemplateArguments(Args, NumArgs, InstantiationDependent)) && "No
canonical type for non-dependent class template specialization", file
..\..\..\..\..\tools\clang\lib\AST\Type.cpp, line 1917

This affects MSVC 2008 <list> header but I was able to reduce it to a much more
reasonable test case:


template<class T> class list {
  template <bool> class A;
  friend class A<0>;

Steps to reproduce:

1. Generate PCH
clang -cc1 -xc++ -emit-pch -o pch.h.pch pch.h

2. Compile file with PCH
clang -cc1 -xc++ -include-pch pch.h.pch main.cpp

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.

More information about the llvm-bugs mailing list