File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -2511,7 +2511,6 @@ bool CXXNameMangler::mangleUnresolvedTypeOrSimpleId(QualType Ty,
2511
2511
case Type::PackIndexing:
2512
2512
case Type::TemplateTypeParm:
2513
2513
case Type::UnaryTransform:
2514
- case Type::SubstTemplateTypeParm:
2515
2514
unresolvedType:
2516
2515
// Some callers want a prefix before the mangled type.
2517
2516
Out << Prefix;
@@ -2524,6 +2523,16 @@ bool CXXNameMangler::mangleUnresolvedTypeOrSimpleId(QualType Ty,
2524
2523
// so we return directly.
2525
2524
return true ;
2526
2525
2526
+ case Type::SubstTemplateTypeParm: {
2527
+ auto *ST = cast<SubstTemplateTypeParmType>(Ty);
2528
+ // If this was replaced from a type alias, this is not substituted
2529
+ // from an outer template parameter, so it's not an unresolved-type.
2530
+ if (auto *TD = dyn_cast<TemplateDecl>(ST->getAssociatedDecl ());
2531
+ TD && TD->isTypeAlias ())
2532
+ return mangleUnresolvedTypeOrSimpleId (ST->getReplacementType (), Prefix);
2533
+ goto unresolvedType;
2534
+ }
2535
+
2527
2536
case Type::Typedef:
2528
2537
mangleSourceNameWithAbiTags (cast<TypedefType>(Ty)->getDecl ());
2529
2538
break ;
Original file line number Diff line number Diff line change @@ -1220,3 +1220,30 @@ namespace test61 {
1220
1220
// CHECK-LABEL: @_ZN6test611fINS_1XEEEvNT_1Y1aENS3_1bE
1221
1221
template void f<X>(int , int );
1222
1222
}
1223
+
1224
+ namespace test62 {
1225
+ template <class > struct integral_constant {
1226
+ static const int value = true ;
1227
+ };
1228
+ template <int > struct _OrImpl {};
1229
+ template <class _Args > using _Or = _OrImpl<_Args::value>;
1230
+ template <class _Up >
1231
+ void f (_Or<integral_constant<_Up>>) {}
1232
+ // CHECK-LABEL: @_ZN6test621fIiEEvNS_7_OrImplIXsr17integral_constantIT_EE5valueEEE
1233
+ template void f<int >(_OrImpl<1 >);
1234
+ } // namespace test62
1235
+
1236
+ namespace test63 {
1237
+ namespace {
1238
+ template <class , class > struct integral_constant {
1239
+ static const int value = true ;
1240
+ };
1241
+ template <class , class > struct _And {};
1242
+ template <int > struct _OrImpl {};
1243
+ template <class _First > using _Or = _OrImpl<_First::value>;
1244
+ template <class _Up >
1245
+ void f (_And<integral_constant<int , void >, _Or<integral_constant<_Up, int >>>);
1246
+ } // namespace
1247
+ // CHECK-LABEL: @_ZN6test6312_GLOBAL__N_11fIiEEvNS0_4_AndINS0_17integral_constantIivEENS0_7_OrImplIXsr17integral_constantIT_iEE5valueEEEEE
1248
+ void g () { f<int >({}); }
1249
+ } // namespace test63
You can’t perform that action at this time.
0 commit comments