Skip to content

Commit 1547ed8

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged origin/amd-debug:e434301ce4eb into origin/amd-gfx:377906eee23e
Local branch origin/amd-gfx 377906e Merged origin/amd-debug:b41ac47893ec into origin/amd-gfx:82337408ba3a Remote branch origin/amd-debug e434301 Merge llvm/main into amd-debug
2 parents 377906e + e434301 commit 1547ed8

File tree

128 files changed

+892
-61
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+892
-61
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 1 deletion

clang/lib/Sema/SemaTemplateDeductionGuide.cpp

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ Expr *buildIsDeducibleConstraint(Sema &SemaRef,
949949
ReturnType = SemaRef.SubstType(
950950
ReturnType, Args, AliasTemplate->getLocation(),
951951
Context.DeclarationNames.getCXXDeductionGuideName(AliasTemplate));
952-
};
952+
}
953953

954954
SmallVector<TypeSourceInfo *> IsDeducibleTypeTraitArgs = {
955955
Context.getTrivialTypeSourceInfo(
@@ -981,7 +981,8 @@ getRHSTemplateDeclAndArgs(Sema &SemaRef, TypeAliasTemplateDecl *AliasTemplate) {
981981
// template<typename T>
982982
// using AliasFoo1 = Foo<T>; // a class/type alias template specialization
983983
Template = TST->getTemplateName().getAsTemplateDecl();
984-
AliasRhsTemplateArgs = TST->template_arguments();
984+
AliasRhsTemplateArgs =
985+
TST->getAsNonAliasTemplateSpecializationType()->template_arguments();
985986
} else if (const auto *RT = RhsType->getAs<RecordType>()) {
986987
// Cases where template arguments in the RHS of the alias are not
987988
// dependent. e.g.
@@ -1025,6 +1026,24 @@ BuildDeductionGuideForTypeAlias(Sema &SemaRef,
10251026
auto [Template, AliasRhsTemplateArgs] =
10261027
getRHSTemplateDeclAndArgs(SemaRef, AliasTemplate);
10271028

1029+
// We need both types desugared, before we continue to perform type deduction.
1030+
// The intent is to get the template argument list 'matched', e.g. in the
1031+
// following case:
1032+
//
1033+
//
1034+
// template <class T>
1035+
// struct A {};
1036+
// template <class T>
1037+
// using Foo = A<A<T>>;
1038+
// template <class U = int>
1039+
// using Bar = Foo<U>;
1040+
//
1041+
// In terms of Bar, we want U (which has the default argument) to appear in
1042+
// the synthesized deduction guide, but U would remain undeduced if we deduced
1043+
// A<A<T>> using Foo<U> directly.
1044+
//
1045+
// Instead, we need to canonicalize both against A, i.e. A<A<T>> and A<A<U>>,
1046+
// such that T can be deduced as U.
10281047
auto RType = F->getTemplatedDecl()->getReturnType();
10291048
// The (trailing) return type of the deduction guide.
10301049
const TemplateSpecializationType *FReturnType =
@@ -1034,7 +1053,7 @@ BuildDeductionGuideForTypeAlias(Sema &SemaRef,
10341053
FReturnType = InjectedCNT->getInjectedTST();
10351054
else if (const auto *ET = RType->getAs<ElaboratedType>())
10361055
// explicit deduction guide.
1037-
FReturnType = ET->getNamedType()->getAs<TemplateSpecializationType>();
1056+
FReturnType = ET->getNamedType()->getAsNonAliasTemplateSpecializationType();
10381057
assert(FReturnType && "expected to see a return type");
10391058
// Deduce template arguments of the deduction guide f from the RHS of
10401059
// the alias.

clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/non-policy/non-overloaded/vaesdf.c renamed to clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/vector-crypto/non-policy/non-overloaded/vaesdf.c

File renamed without changes.

clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/non-policy/non-overloaded/vaesdm.c renamed to clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/vector-crypto/non-policy/non-overloaded/vaesdm.c

File renamed without changes.

clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/non-policy/non-overloaded/vaesef.c renamed to clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/vector-crypto/non-policy/non-overloaded/vaesef.c

File renamed without changes.

clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/non-policy/non-overloaded/vaesem.c renamed to clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/vector-crypto/non-policy/non-overloaded/vaesem.c

File renamed without changes.

clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/non-policy/non-overloaded/vaeskf1.c renamed to clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/vector-crypto/non-policy/non-overloaded/vaeskf1.c

File renamed without changes.

clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/non-policy/non-overloaded/vaeskf2.c renamed to clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/vector-crypto/non-policy/non-overloaded/vaeskf2.c

File renamed without changes.

clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/non-policy/non-overloaded/vaesz.c renamed to clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/vector-crypto/non-policy/non-overloaded/vaesz.c

File renamed without changes.

clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/non-policy/non-overloaded/vandn.c renamed to clang/test/CodeGen/RISCV/rvv-intrinsics-autogenerated/vector-crypto/non-policy/non-overloaded/vandn.c

File renamed without changes.

0 commit comments

Comments
 (0)