r272079 - [ItaniumMangle] Mangle dependent __underlying_type correctly

David Majnemer via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 7 17:34:15 PDT 2016


Author: majnemer
Date: Tue Jun  7 19:34:15 2016
New Revision: 272079

URL: http://llvm.org/viewvc/llvm-project?rev=272079&view=rev
Log:
[ItaniumMangle] Mangle dependent __underlying_type correctly

We attempted to use the UnaryTransformType's UnderlyingType instead of
it's BaseType.  This is not correct for dependent UnaryTransformType
because the have no underlying type.

This fixes PR28045.

Modified:
    cfe/trunk/lib/AST/ItaniumMangle.cpp
    cfe/trunk/test/CodeGenCXX/mangle.cpp

Modified: cfe/trunk/lib/AST/ItaniumMangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ItaniumMangle.cpp?rev=272079&r1=272078&r2=272079&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ItaniumMangle.cpp (original)
+++ cfe/trunk/lib/AST/ItaniumMangle.cpp Tue Jun  7 19:34:15 2016
@@ -2736,7 +2736,7 @@ void CXXNameMangler::mangleType(const Un
     }
   }
 
-  mangleType(T->getUnderlyingType());
+  mangleType(T->getBaseType());
 }
 
 void CXXNameMangler::mangleType(const AutoType *T) {

Modified: cfe/trunk/test/CodeGenCXX/mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle.cpp?rev=272079&r1=272078&r2=272079&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle.cpp Tue Jun  7 19:34:15 2016
@@ -1101,3 +1101,13 @@ struct c {
   // CHECK-LABEL: @_ZN6test541cC2EPNS0_Ut0_E
 };
 }
+
+namespace test55 {
+enum E { R };
+
+template <typename T>
+void fn(T, __underlying_type(T)) {}
+
+template void fn<E>(E, __underlying_type(E));
+// CHECK-LABEL: @_ZN6test552fnINS_1EEEEvT_U3eutS2_
+}




More information about the cfe-commits mailing list