From: David Majnemer Date: Wed, 8 Jun 2016 00:34:15 +0000 (+0000) Subject: [ItaniumMangle] Mangle dependent __underlying_type correctly X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4ecfbf35ef8823ddb6e3c42dd08ded29c225383a;p=clang [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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272079 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ItaniumMangle.cpp b/lib/AST/ItaniumMangle.cpp index 1d40d42c11..bb4039e7f3 100644 --- a/lib/AST/ItaniumMangle.cpp +++ b/lib/AST/ItaniumMangle.cpp @@ -2736,7 +2736,7 @@ void CXXNameMangler::mangleType(const UnaryTransformType *T) { } } - mangleType(T->getUnderlyingType()); + mangleType(T->getBaseType()); } void CXXNameMangler::mangleType(const AutoType *T) { diff --git a/test/CodeGenCXX/mangle.cpp b/test/CodeGenCXX/mangle.cpp index 5012c3b379..5d757102ed 100644 --- a/test/CodeGenCXX/mangle.cpp +++ b/test/CodeGenCXX/mangle.cpp @@ -1101,3 +1101,13 @@ struct c { // CHECK-LABEL: @_ZN6test541cC2EPNS0_Ut0_E }; } + +namespace test55 { +enum E { R }; + +template +void fn(T, __underlying_type(T)) {} + +template void fn(E, __underlying_type(E)); +// CHECK-LABEL: @_ZN6test552fnINS_1EEEEvT_U3eutS2_ +}