[llvm-branch-commits] [cfe-branch] r293702 - Merging r292194:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jan 31 14:31:46 PST 2017


Author: hans
Date: Tue Jan 31 16:31:45 2017
New Revision: 293702

URL: http://llvm.org/viewvc/llvm-project?rev=293702&view=rev
Log:
Merging r292194:
------------------------------------------------------------------------
r292194 | majnemer | 2017-01-16 20:14:25 -0800 (Mon, 16 Jan 2017) | 8 lines

[AST] AttributedType should derive type properties from the EquivalentType

Using the canonical type instead of the equivalent type can result in
insufficient template instantiations.

This fixes PR31656.

Differential Revision: https://reviews.llvm.org/D28788
------------------------------------------------------------------------

Modified:
    cfe/branches/release_40/   (props changed)
    cfe/branches/release_40/include/clang/AST/Type.h
    cfe/branches/release_40/test/CodeGenCXX/microsoft-abi-default-cc.cpp

Propchange: cfe/branches/release_40/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 31 16:31:45 2017
@@ -1,4 +1,4 @@
 /cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:291850,291853,291865,291871,291877,291879,291881,291907,291955,291964,292032,292052,292183,292247,292265,292497,292555,292558-292559,292561,292590,292800,292847,292874,292991,293134,293596
+/cfe/trunk:291850,291853,291865,291871,291877,291879,291881,291907,291955,291964,292032,292052,292183,292194,292247,292265,292497,292555,292558-292559,292561,292590,292800,292847,292874,292991,293134,293596
 /cfe/trunk/test:170344
 /cfe/trunk/test/SemaTemplate:126920

Modified: cfe/branches/release_40/include/clang/AST/Type.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_40/include/clang/AST/Type.h?rev=293702&r1=293701&r2=293702&view=diff
==============================================================================
--- cfe/branches/release_40/include/clang/AST/Type.h (original)
+++ cfe/branches/release_40/include/clang/AST/Type.h Tue Jan 31 16:31:45 2017
@@ -3827,13 +3827,13 @@ private:
 
   friend class ASTContext; // creates these
 
-  AttributedType(QualType canon, Kind attrKind,
-                 QualType modified, QualType equivalent)
-    : Type(Attributed, canon, canon->isDependentType(),
-           canon->isInstantiationDependentType(),
-           canon->isVariablyModifiedType(),
-           canon->containsUnexpandedParameterPack()),
-      ModifiedType(modified), EquivalentType(equivalent) {
+  AttributedType(QualType canon, Kind attrKind, QualType modified,
+                 QualType equivalent)
+      : Type(Attributed, canon, equivalent->isDependentType(),
+             equivalent->isInstantiationDependentType(),
+             equivalent->isVariablyModifiedType(),
+             equivalent->containsUnexpandedParameterPack()),
+        ModifiedType(modified), EquivalentType(equivalent) {
     AttributedTypeBits.AttrKind = attrKind;
   }
 

Modified: cfe/branches/release_40/test/CodeGenCXX/microsoft-abi-default-cc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_40/test/CodeGenCXX/microsoft-abi-default-cc.cpp?rev=293702&r1=293701&r2=293702&view=diff
==============================================================================
--- cfe/branches/release_40/test/CodeGenCXX/microsoft-abi-default-cc.cpp (original)
+++ cfe/branches/release_40/test/CodeGenCXX/microsoft-abi-default-cc.cpp Tue Jan 31 16:31:45 2017
@@ -45,3 +45,12 @@ void __cdecl static_baz() {}
 void static_qux() {}
 // GCABI-LABEL: define void @_Z10static_quxv
 // MSABI: define void @"\01?static_qux@@YAXXZ"
+
+namespace PR31656 {
+template <int I>
+void __cdecl callee(int args[I]);
+// GCABI-LABEL: declare void @_ZN7PR316566calleeILi1EEEvPi(
+// MSABI: declare void @"\01??$callee@$00 at PR31656@@YAXQAH at Z"(
+
+void caller() { callee<1>(0); }
+}




More information about the llvm-branch-commits mailing list