[PATCH] Fix PR1806: Canonicalize the replacement type when deserializing a SubstTemplateTypeParmType

Stephan Tolksdorf st at quanttec.com
Thu Mar 13 14:50:03 PDT 2014


Hi rsmith,

Given the trivial nature of the patch and the relatively difficulty of testing this (see the test case in the PR), I suppose that we don't need a new test.

http://llvm-reviews.chandlerc.com/D3073

Files:
  lib/Serialization/ASTReader.cpp

Index: lib/Serialization/ASTReader.cpp
===================================================================
--- lib/Serialization/ASTReader.cpp
+++ lib/Serialization/ASTReader.cpp
@@ -5189,9 +5189,9 @@
     unsigned Idx = 0;
     QualType Parm = readType(*Loc.F, Record, Idx);
     QualType Replacement = readType(*Loc.F, Record, Idx);
-    return
-      Context.getSubstTemplateTypeParmType(cast<TemplateTypeParmType>(Parm),
-                                            Replacement);
+    return Context.getSubstTemplateTypeParmType(
+        cast<TemplateTypeParmType>(Parm),
+        Context.getCanonicalType(Replacement));
   }
 
   case TYPE_SUBST_TEMPLATE_TYPE_PARM_PACK: {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3073.1.patch
Type: text/x-patch
Size: 679 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140313/0ffd58ee/attachment.bin>


More information about the cfe-commits mailing list