cor3ntin wrote:
@antangelo @erichkeane @hokein Should we try to land this now?
https://github.com/llvm/llvm-project/pull/98788
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hokein wrote:
> I like 1, but not really 2, I think we should wait for this to be reasonably
> complete before merging it, particularly this close to the release. I'd
> probably be ok with 2 if we wait a few weeks until after the release, so that
> we can deal with the fallout with less stress
@@ -2010,6 +2032,25 @@ class CXXDeductionGuideDecl : public FunctionDecl {
/// this is an implicit deduction guide.
CXXConstructorDecl *getCorrespondingConstructor() const { return Ctor; }
+ /// Get the deduction guide from which this deduction guide was generated,
+ ///
antangelo wrote:
I have split the source deduction guide tracking into #123875, and will
continue working on fixing the remaining issues here to land P2582R1 for clang
21.
https://github.com/llvm/llvm-project/pull/98788
___
cfe-commits mailing list
c
erichkeane wrote:
> Both 1 and 2 seems like good options @hokein @erichkeane (especially 1 is
> probably something we should try to do)
I like 1, but not really 2, I think we should wait for this to be reasonably
complete before merging it, particularly this close to the release. I'd
probabl
cor3ntin wrote:
Both 1 and 2 seems like good options @hokein @erichkeane
(especially 1 is probably something we should try to do)
https://github.com/llvm/llvm-project/pull/98788
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llv
antangelo wrote:
I'm still working on addressing the remaining comments, primarily the one from
Erich about insufficient handling of nested templates. There are some issues
when the derived class is in a nested template, and the base specifier depends
on the outer template arguments, where the
cor3ntin wrote:
@antangelo @hokein What's the status here?
If this is not merged by next week it won't make clang 20 (and there are
unaddressed comments)
Thanks!
https://github.com/llvm/llvm-project/pull/98788
___
cfe-commits mailing list
cfe-commits
@@ -10615,6 +10615,40 @@ bool clang::isBetterOverloadCandidate(
auto *Guide1 = dyn_cast_or_null(Cand1.Function);
auto *Guide2 = dyn_cast_or_null(Cand2.Function);
if (Guide1 && Guide2) {
+ // -- F1 and F2 are generated from class template argument deduction
+
@@ -2010,6 +2032,25 @@ class CXXDeductionGuideDecl : public FunctionDecl {
/// this is an implicit deduction guide.
CXXConstructorDecl *getCorrespondingConstructor() const { return Ctor; }
+ /// Get the deduction guide from which this deduction guide was generated,
+ ///
@@ -10615,6 +10615,40 @@ bool clang::isBetterOverloadCandidate(
auto *Guide1 = dyn_cast_or_null(Cand1.Function);
auto *Guide2 = dyn_cast_or_null(Cand2.Function);
if (Guide1 && Guide2) {
+ // -- F1 and F2 are generated from class template argument deduction
+
https://github.com/erichkeane edited
https://github.com/llvm/llvm-project/pull/98788
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -942,34 +946,145 @@ getRHSTemplateDeclAndArgs(Sema &SemaRef,
TypeAliasTemplateDecl *AliasTemplate) {
return {Template, AliasRhsTemplateArgs};
}
+struct InheritedConstructorDeductionInfo {
+ // Class template for which we are declaring deduction guides
+ // This is `C`
@@ -942,34 +946,145 @@ getRHSTemplateDeclAndArgs(Sema &SemaRef,
TypeAliasTemplateDecl *AliasTemplate) {
return {Template, AliasRhsTemplateArgs};
}
+struct InheritedConstructorDeductionInfo {
+ // Class template for which we are declaring deduction guides
+ // This is `C`
https://github.com/erichkeane commented:
I don't think I'm needed on this review again, but did a pass through and had
some comments/suggestions. Nothing binding, so I'll let others discuss
this/accept this.
https://github.com/llvm/llvm-project/pull/98788
_
@@ -2246,18 +2246,21 @@ CXXDeductionGuideDecl *CXXDeductionGuideDecl::Create(
ASTContext &C, DeclContext *DC, SourceLocation StartLoc,
ExplicitSpecifier ES, const DeclarationNameInfo &NameInfo, QualType T,
TypeSourceInfo *TInfo, SourceLocation EndLocation, CXXConstr
@@ -1960,24 +1960,44 @@ class ExplicitSpecifier {
class CXXDeductionGuideDecl : public FunctionDecl {
void anchor() override;
+public:
+ // Represents the relationship between this deduction guide and the
+ // deduction guide that it was generated from (or lack thereof).
+
@@ -2010,6 +2032,25 @@ class CXXDeductionGuideDecl : public FunctionDecl {
/// this is an implicit deduction guide.
CXXConstructorDecl *getCorrespondingConstructor() const { return Ctor; }
+ /// Get the deduction guide from which this deduction guide was generated,
+ ///
@@ -2010,6 +2031,25 @@ class CXXDeductionGuideDecl : public FunctionDecl {
/// this is an implicit deduction guide.
CXXConstructorDecl *getCorrespondingConstructor() const { return Ctor; }
+ /// Get the deduction guide from which this deduction guide was generated,
+ ///
@@ -931,12 +935,73 @@ getRHSTemplateDeclAndArgs(Sema &SemaRef,
TypeAliasTemplateDecl *AliasTemplate) {
return {Template, AliasRhsTemplateArgs};
}
+struct InheritedConstructorDeductionInfo {
+ // Class template for which we are declaring deduction guides
+ // This is `C` i
@@ -11757,6 +11791,42 @@ static void DiagnoseBadDeduction(Sema &S, NamedDecl
*Found, Decl *Templated,
return;
}
+// Errors in deduction guides from inherited constructors
+// will manifest as substitution failures in the return type
+// partial specializ
@@ -1173,25 +1276,52 @@ void DeclareImplicitDeductionGuidesForTypeAlias(
NewParam->setScopeInfo(0, I);
FPTL.setParam(I, NewParam);
}
- auto *Transformed = cast(buildDeductionGuide(
- SemaRef, AliasTemplate, /*TemplateParams=*/nullptr,
+
+
@@ -942,34 +946,145 @@ getRHSTemplateDeclAndArgs(Sema &SemaRef,
TypeAliasTemplateDecl *AliasTemplate) {
return {Template, AliasRhsTemplateArgs};
}
+struct InheritedConstructorDeductionInfo {
+ // Class template for which we are declaring deduction guides
+ // This is `C`
@@ -10615,6 +10615,40 @@ bool clang::isBetterOverloadCandidate(
auto *Guide1 = dyn_cast_or_null(Cand1.Function);
auto *Guide2 = dyn_cast_or_null(Cand2.Function);
if (Guide1 && Guide2) {
+ // -- F1 and F2 are generated from class template argument deduction
+
@@ -931,12 +935,73 @@ getRHSTemplateDeclAndArgs(Sema &SemaRef,
TypeAliasTemplateDecl *AliasTemplate) {
return {Template, AliasRhsTemplateArgs};
}
+struct InheritedConstructorDeductionInfo {
+ // Class template for which we are declaring deduction guides
+ // This is `C` i
@@ -1203,10 +1333,291 @@ void DeclareImplicitDeductionGuidesForTypeAlias(
->getDeductionCandidateKind() == DeductionCandidate::Aggregate)
continue;
-BuildDeductionGuideForTypeAlias(SemaRef, AliasTemplate, F, Loc);
+BuildDeductionGuideForTypeAlias(Sema
@@ -1203,10 +1333,291 @@ void DeclareImplicitDeductionGuidesForTypeAlias(
->getDeductionCandidateKind() == DeductionCandidate::Aggregate)
continue;
-BuildDeductionGuideForTypeAlias(SemaRef, AliasTemplate, F, Loc);
+BuildDeductionGuideForTypeAlias(Sema
@@ -931,12 +935,73 @@ getRHSTemplateDeclAndArgs(Sema &SemaRef,
TypeAliasTemplateDecl *AliasTemplate) {
return {Template, AliasRhsTemplateArgs};
}
+struct InheritedConstructorDeductionInfo {
+ // Class template for which we are declaring deduction guides
+ // This is `C` i
@@ -11757,6 +11791,42 @@ static void DiagnoseBadDeduction(Sema &S, NamedDecl
*Found, Decl *Templated,
return;
}
+// Errors in deduction guides from inherited constructors
+// will manifest as substitution failures in the return type
+// partial specializ
@@ -936,19 +940,21 @@ Expr *buildIsDeducibleConstraint(Sema &SemaRef,
Context.DeclarationNames.getCXXDeductionGuideName(AliasTemplate));
};
+ TemplateDecl *TD = DeducingTemplate ? DeducingTemplate : AliasTemplate;
+
SmallVector IsDeducibleTypeTraitArgs = {
@@ -931,12 +935,73 @@ getRHSTemplateDeclAndArgs(Sema &SemaRef,
TypeAliasTemplateDecl *AliasTemplate) {
return {Template, AliasRhsTemplateArgs};
}
+struct InheritedConstructorDeductionInfo {
+ // Class template for which we are declaring deduction guides
+ // This is `C` i
@@ -1173,25 +1276,52 @@ void DeclareImplicitDeductionGuidesForTypeAlias(
NewParam->setScopeInfo(0, I);
FPTL.setParam(I, NewParam);
}
- auto *Transformed = cast(buildDeductionGuide(
- SemaRef, AliasTemplate, /*TemplateParams=*/nullptr,
+
+
@@ -931,12 +935,73 @@ getRHSTemplateDeclAndArgs(Sema &SemaRef,
TypeAliasTemplateDecl *AliasTemplate) {
return {Template, AliasRhsTemplateArgs};
}
+struct InheritedConstructorDeductionInfo {
+ // Class template for which we are declaring deduction guides
+ // This is `C` i
@@ -931,12 +935,73 @@ getRHSTemplateDeclAndArgs(Sema &SemaRef,
TypeAliasTemplateDecl *AliasTemplate) {
return {Template, AliasRhsTemplateArgs};
}
+struct InheritedConstructorDeductionInfo {
+ // Class template for which we are declaring deduction guides
+ // This is `C` i
@@ -931,12 +935,73 @@ getRHSTemplateDeclAndArgs(Sema &SemaRef,
TypeAliasTemplateDecl *AliasTemplate) {
return {Template, AliasRhsTemplateArgs};
}
+struct InheritedConstructorDeductionInfo {
+ // Class template for which we are declaring deduction guides
+ // This is `C` i
@@ -11757,6 +11791,42 @@ static void DiagnoseBadDeduction(Sema &S, NamedDecl
*Found, Decl *Templated,
return;
}
+// Errors in deduction guides from inherited constructors
+// will manifest as substitution failures in the return type
+// partial specializ
@@ -931,12 +935,73 @@ getRHSTemplateDeclAndArgs(Sema &SemaRef,
TypeAliasTemplateDecl *AliasTemplate) {
return {Template, AliasRhsTemplateArgs};
}
+struct InheritedConstructorDeductionInfo {
+ // Class template for which we are declaring deduction guides
+ // This is `C` i
@@ -1203,10 +1333,291 @@ void DeclareImplicitDeductionGuidesForTypeAlias(
->getDeductionCandidateKind() == DeductionCandidate::Aggregate)
continue;
-BuildDeductionGuideForTypeAlias(SemaRef, AliasTemplate, F, Loc);
+BuildDeductionGuideForTypeAlias(Sema
@@ -10615,6 +10615,40 @@ bool clang::isBetterOverloadCandidate(
auto *Guide1 = dyn_cast_or_null(Cand1.Function);
auto *Guide2 = dyn_cast_or_null(Cand2.Function);
if (Guide1 && Guide2) {
+ // -- F1 and F2 are generated from class template argument deduction
+
@@ -2010,6 +2031,25 @@ class CXXDeductionGuideDecl : public FunctionDecl {
/// this is an implicit deduction guide.
CXXConstructorDecl *getCorrespondingConstructor() const { return Ctor; }
+ /// Get the deduction guide from which this deduction guide was generated,
+ ///
@@ -11757,6 +11791,42 @@ static void DiagnoseBadDeduction(Sema &S, NamedDecl
*Found, Decl *Templated,
return;
}
+// Errors in deduction guides from inherited constructors
+// will manifest as substitution failures in the return type
+// partial specializ
@@ -1203,10 +1333,291 @@ void DeclareImplicitDeductionGuidesForTypeAlias(
->getDeductionCandidateKind() == DeductionCandidate::Aggregate)
continue;
-BuildDeductionGuideForTypeAlias(SemaRef, AliasTemplate, F, Loc);
+BuildDeductionGuideForTypeAlias(Sema
@@ -931,12 +935,73 @@ getRHSTemplateDeclAndArgs(Sema &SemaRef,
TypeAliasTemplateDecl *AliasTemplate) {
return {Template, AliasRhsTemplateArgs};
}
+struct InheritedConstructorDeductionInfo {
+ // Class template for which we are declaring deduction guides
+ // This is `C` i
https://github.com/antangelo edited
https://github.com/llvm/llvm-project/pull/98788
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,316 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c++23 -verify %s
+
+namespace test1 {
+ template struct Base {
+template requires true
+Base(T);
+ };
+
+ template struct InheritsCtors : public Base {
+using Base::Base;
+ };
+
+ InheritsCtors inheritsCtors
@@ -1203,10 +1333,291 @@ void DeclareImplicitDeductionGuidesForTypeAlias(
->getDeductionCandidateKind() == DeductionCandidate::Aggregate)
continue;
-BuildDeductionGuideForTypeAlias(SemaRef, AliasTemplate, F, Loc);
+BuildDeductionGuideForTypeAlias(Sema
@@ -2010,6 +2031,25 @@ class CXXDeductionGuideDecl : public FunctionDecl {
/// this is an implicit deduction guide.
CXXConstructorDecl *getCorrespondingConstructor() const { return Ctor; }
+ /// Get the deduction guide from which this deduction guide was generated,
+ ///
@@ -0,0 +1,316 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c++23 -verify %s
+
+namespace test1 {
+ template struct Base {
+template requires true
+Base(T);
+ };
+
+ template struct InheritsCtors : public Base {
+using Base::Base;
+ };
+
+ InheritsCtors inheritsCtors
@@ -1203,10 +1333,291 @@ void DeclareImplicitDeductionGuidesForTypeAlias(
->getDeductionCandidateKind() == DeductionCandidate::Aggregate)
continue;
-BuildDeductionGuideForTypeAlias(SemaRef, AliasTemplate, F, Loc);
+BuildDeductionGuideForTypeAlias(Sema
@@ -1960,24 +1960,38 @@ class ExplicitSpecifier {
class CXXDeductionGuideDecl : public FunctionDecl {
void anchor() override;
+public:
+ enum class SourceKind {
hokein wrote:
@cor3ntin, if you have any ideas for a better name, could you suggest one?
I thi
hokein wrote:
> Thanks for the reviews!
>
> > ```
> > * can you give a description if what needs to be done in subsequent PRs?
> > (maybe cxx_status.html should say "partial"
> > ```
>
> The remaining tasks are:
>
> * Supporting dependent using-declarators such as `using Derived::Base::Base`
@@ -58,7 +58,7 @@ inline InheritableAttr *getDLLAttr(Decl *D) {
}
/// Retrieve the depth and index of a template parameter.
-inline std::pair getDepthAndIndex(NamedDecl *ND) {
+inline std::pair getDepthAndIndex(const NamedDecl *ND) {
antangelo wrote:
Done, se
@@ -58,7 +58,7 @@ inline InheritableAttr *getDLLAttr(Decl *D) {
}
/// Retrieve the depth and index of a template parameter.
-inline std::pair getDepthAndIndex(NamedDecl *ND) {
+inline std::pair getDepthAndIndex(const NamedDecl *ND) {
antangelo wrote:
I'll spl
@@ -1216,10 +1308,225 @@ void DeclareImplicitDeductionGuidesForTypeAlias(
->getDeductionCandidateKind() == DeductionCandidate::Aggregate)
continue;
-BuildDeductionGuideForTypeAlias(SemaRef, AliasTemplate, F, Loc);
+BuildDeductionGuideForTypeAlias(Sema
antangelo wrote:
Thanks for the reviews!
> * can you give a description if what needs to be done in subsequent PRs?
> (maybe cxx_status.html should say "partial"
The remaining tasks are:
- Supporting dependent using-declarators such as `using Derived::Base::Base`.
These are somewhat annoy
@@ -11758,6 +11795,40 @@ static void DiagnoseBadDeduction(Sema &S, NamedDecl
*Found, Decl *Templated,
return;
}
+// Errors in deduction guides from inherited constructors
+// will present as substitution failures in the mapping
+// partial specialization
@@ -1398,5 +1807,30 @@ void Sema::DeclareImplicitDeductionGuides(TemplateDecl
*Template,
->getTemplatedDecl())
->setDeductionCandidateKind(DeductionCandidate::Copy);
+ CXXRecordDecl *TemplatedDecl = Pattern->getTemplatedDecl();
+ if (getLangOpts().CPlusPlus2
@@ -931,12 +935,73 @@ getRHSTemplateDeclAndArgs(Sema &SemaRef,
TypeAliasTemplateDecl *AliasTemplate) {
return {Template, AliasRhsTemplateArgs};
}
+struct InheritedConstructorDeductionInfo {
+ // Class template for which we are declaring deduction guides
+ // This is `C` i
@@ -899,7 +902,8 @@ Expr *buildIsDeducibleConstraint(Sema &SemaRef,
return TypeTraitExpr::Create(
Context, Context.getLogicalOperationType(), AliasTemplate->getLocation(),
TypeTrait::BTT_IsDeducible, IsDeducibleTypeTraitArgs,
- AliasTemplate->getLocation(), /
@@ -11758,6 +11795,40 @@ static void DiagnoseBadDeduction(Sema &S, NamedDecl
*Found, Decl *Templated,
return;
}
+// Errors in deduction guides from inherited constructors
+// will present as substitution failures in the mapping
+// partial specialization
@@ -11758,6 +11795,40 @@ static void DiagnoseBadDeduction(Sema &S, NamedDecl
*Found, Decl *Templated,
return;
}
+// Errors in deduction guides from inherited constructors
+// will present as substitution failures in the mapping
antangelo wro
@@ -10616,6 +10616,43 @@ bool clang::isBetterOverloadCandidate(
auto *Guide1 = dyn_cast_or_null(Cand1.Function);
auto *Guide2 = dyn_cast_or_null(Cand2.Function);
if (Guide1 && Guide2) {
+ // -- F1 and F2 are generated from class template argument deduction
+
@@ -10616,6 +10616,43 @@ bool clang::isBetterOverloadCandidate(
auto *Guide1 = dyn_cast_or_null(Cand1.Function);
auto *Guide2 = dyn_cast_or_null(Cand2.Function);
if (Guide1 && Guide2) {
+ // -- F1 and F2 are generated from class template argument deduction
+
@@ -1960,24 +1960,38 @@ class ExplicitSpecifier {
class CXXDeductionGuideDecl : public FunctionDecl {
void anchor() override;
+public:
+ enum class SourceKind {
antangelo wrote:
Done, renamed to `SourceDeductionGuideKind` to align with the class member and
@@ -1107,8 +1172,32 @@ BuildDeductionGuideForTypeAlias(Sema &SemaRef,
Sema::CodeSynthesisContext::BuildingDeductionGuides)) {
auto *GG = cast(FPrime);
-Expr *IsDeducible = buildIsDeducibleConstraint(
-SemaRef, AliasTemplate, FPrime->getReturnType(), F
https://github.com/hokein approved this pull request.
Thanks! It looks good from my side. Please address the comments from the other
reviewers and wait a bit before landing, in case they have additional feedback.
https://github.com/llvm/llvm-project/pull/98788
__
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/98788
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1216,10 +1308,225 @@ void DeclareImplicitDeductionGuidesForTypeAlias(
->getDeductionCandidateKind() == DeductionCandidate::Aggregate)
continue;
-BuildDeductionGuideForTypeAlias(SemaRef, AliasTemplate, F, Loc);
+BuildDeductionGuideForTypeAlias(Sema
@@ -11723,6 +11764,40 @@ static void DiagnoseBadDeduction(Sema &S, NamedDecl
*Found, Decl *Templated,
return;
}
+// Errors in deduction guides from inherited constructors
+// will present as substitution failures in the mapping
+// partial specialization
@@ -10616,6 +10616,43 @@ bool clang::isBetterOverloadCandidate(
auto *Guide1 = dyn_cast_or_null(Cand1.Function);
auto *Guide2 = dyn_cast_or_null(Cand2.Function);
if (Guide1 && Guide2) {
+ // -- F1 and F2 are generated from class template argument deduction
+
@@ -1398,5 +1807,30 @@ void Sema::DeclareImplicitDeductionGuides(TemplateDecl
*Template,
->getTemplatedDecl())
->setDeductionCandidateKind(DeductionCandidate::Copy);
+ CXXRecordDecl *TemplatedDecl = Pattern->getTemplatedDecl();
+ if (getLangOpts().CPlusPlus2
@@ -11758,6 +11795,40 @@ static void DiagnoseBadDeduction(Sema &S, NamedDecl
*Found, Decl *Templated,
return;
}
+// Errors in deduction guides from inherited constructors
+// will present as substitution failures in the mapping
+// partial specialization
@@ -58,7 +58,7 @@ inline InheritableAttr *getDLLAttr(Decl *D) {
}
/// Retrieve the depth and index of a template parameter.
-inline std::pair getDepthAndIndex(NamedDecl *ND) {
+inline std::pair getDepthAndIndex(const NamedDecl *ND) {
cor3ntin wrote:
This coul
@@ -899,7 +902,8 @@ Expr *buildIsDeducibleConstraint(Sema &SemaRef,
return TypeTraitExpr::Create(
Context, Context.getLogicalOperationType(), AliasTemplate->getLocation(),
TypeTrait::BTT_IsDeducible, IsDeducibleTypeTraitArgs,
- AliasTemplate->getLocation(), /
@@ -10616,6 +10616,43 @@ bool clang::isBetterOverloadCandidate(
auto *Guide1 = dyn_cast_or_null(Cand1.Function);
auto *Guide2 = dyn_cast_or_null(Cand2.Function);
if (Guide1 && Guide2) {
+ // -- F1 and F2 are generated from class template argument deduction
+
@@ -11758,6 +11795,40 @@ static void DiagnoseBadDeduction(Sema &S, NamedDecl
*Found, Decl *Templated,
return;
}
+// Errors in deduction guides from inherited constructors
+// will present as substitution failures in the mapping
cor3ntin wrot
@@ -11758,6 +11795,40 @@ static void DiagnoseBadDeduction(Sema &S, NamedDecl
*Found, Decl *Templated,
return;
}
+// Errors in deduction guides from inherited constructors
+// will present as substitution failures in the mapping
+// partial specialization
https://github.com/cor3ntin commented:
I think that this looks generally good
A few comments
- can you give a description if what needs to be done in subsequent PRs?
(maybe cxx_status.html should say "partial"
- can you add a release notes
- can you add PCH or module tests for the changes t
@@ -931,12 +935,73 @@ getRHSTemplateDeclAndArgs(Sema &SemaRef,
TypeAliasTemplateDecl *AliasTemplate) {
return {Template, AliasRhsTemplateArgs};
}
+struct InheritedConstructorDeductionInfo {
+ // Class template for which we are declaring deduction guides
+ // This is `C` i
https://github.com/cor3ntin edited
https://github.com/llvm/llvm-project/pull/98788
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1960,24 +1960,38 @@ class ExplicitSpecifier {
class CXXDeductionGuideDecl : public FunctionDecl {
void anchor() override;
+public:
+ enum class SourceKind {
cor3ntin wrote:
Can we get a better name / comment for this enum?
https://github.com/llvm/llvm
@@ -1107,8 +1172,32 @@ BuildDeductionGuideForTypeAlias(Sema &SemaRef,
Sema::CodeSynthesisContext::BuildingDeductionGuides)) {
auto *GG = cast(FPrime);
-Expr *IsDeducible = buildIsDeducibleConstraint(
-SemaRef, AliasTemplate, FPrime->getReturnType(), F
@@ -1216,10 +1308,225 @@ void DeclareImplicitDeductionGuidesForTypeAlias(
->getDeductionCandidateKind() == DeductionCandidate::Aggregate)
continue;
-BuildDeductionGuideForTypeAlias(SemaRef, AliasTemplate, F, Loc);
+BuildDeductionGuideForTypeAlias(Sema
@@ -1216,10 +1308,225 @@ void DeclareImplicitDeductionGuidesForTypeAlias(
->getDeductionCandidateKind() == DeductionCandidate::Aggregate)
continue;
-BuildDeductionGuideForTypeAlias(SemaRef, AliasTemplate, F, Loc);
+BuildDeductionGuideForTypeAlias(Sema
https://github.com/antangelo edited
https://github.com/llvm/llvm-project/pull/98788
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -634,7 +634,7 @@ struct ConvertConstructorToDeductionGuideTransform {
// Find all template parameters that appear in the given DeducedArgs.
// Return the indices of the template parameters in the TemplateParams.
-SmallVector TemplateParamsReferencedInTemplateArgumentList(
+
@@ -1216,10 +1328,280 @@ void DeclareImplicitDeductionGuidesForTypeAlias(
->getDeductionCandidateKind() == DeductionCandidate::Aggregate)
continue;
-BuildDeductionGuideForTypeAlias(SemaRef, AliasTemplate, F, Loc);
+BuildDeductionGuideForTypeAlias(Sema
@@ -944,12 +950,72 @@ getRHSTemplateDeclAndArgs(Sema &SemaRef,
TypeAliasTemplateDecl *AliasTemplate) {
return {Template, AliasRhsTemplateArgs};
}
+struct InheritedConstructorDeductionInfo {
+ // Class template for which we are declaring deduction guides
+ // This is `C` i
@@ -1216,10 +1328,280 @@ void DeclareImplicitDeductionGuidesForTypeAlias(
->getDeductionCandidateKind() == DeductionCandidate::Aggregate)
continue;
-BuildDeductionGuideForTypeAlias(SemaRef, AliasTemplate, F, Loc);
+BuildDeductionGuideForTypeAlias(Sema
@@ -1186,17 +1281,34 @@ void DeclareImplicitDeductionGuidesForTypeAlias(
NewParam->setScopeInfo(0, I);
FPTL.setParam(I, NewParam);
}
- auto *Transformed = cast(buildDeductionGuide(
- SemaRef, AliasTemplate, /*TemplateParams=*/nullptr,
+
+
@@ -944,12 +950,72 @@ getRHSTemplateDeclAndArgs(Sema &SemaRef,
TypeAliasTemplateDecl *AliasTemplate) {
return {Template, AliasRhsTemplateArgs};
}
+struct InheritedConstructorDeductionInfo {
+ // Class template for which we are declaring deduction guides
+ // This is `C` i
@@ -11723,6 +11764,40 @@ static void DiagnoseBadDeduction(Sema &S, NamedDecl
*Found, Decl *Templated,
return;
}
+// Errors in deduction guides from inherited constructors
+// will present as substitution failures in the mapping
+// partial specialization
@@ -10581,6 +10581,47 @@ bool clang::isBetterOverloadCandidate(
auto *Guide1 = dyn_cast_or_null(Cand1.Function);
auto *Guide2 = dyn_cast_or_null(Cand2.Function);
if (Guide1 && Guide2) {
+ // -- F1 and F2 are generated from class template argument deduction
+
@@ -2007,6 +2022,21 @@ class CXXDeductionGuideDecl : public FunctionDecl {
/// this is an implicit deduction guide.
CXXConstructorDecl *getCorrespondingConstructor() const { return Ctor; }
+ /// Get the deduction guide from which this deduction guide was generated,
+ ///
@@ -2211,17 +2211,20 @@ CXXDeductionGuideDecl *CXXDeductionGuideDecl::Create(
ASTContext &C, DeclContext *DC, SourceLocation StartLoc,
ExplicitSpecifier ES, const DeclarationNameInfo &NameInfo, QualType T,
TypeSourceInfo *TInfo, SourceLocation EndLocation, CXXConstr
@@ -944,12 +950,67 @@ getRHSTemplateDeclAndArgs(Sema &SemaRef,
TypeAliasTemplateDecl *AliasTemplate) {
return {Template, AliasRhsTemplateArgs};
}
+struct InheritedConstructorDeductionInfo {
+ TemplateDecl *DerivedClassTemplate;
hokein wrote:
Thanks, it is
https://github.com/hokein commented:
Sorry for the late response, I missed this earlier (it looks generally good).
https://github.com/llvm/llvm-project/pull/98788
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/ma
@@ -634,7 +634,7 @@ struct ConvertConstructorToDeductionGuideTransform {
// Find all template parameters that appear in the given DeducedArgs.
// Return the indices of the template parameters in the TemplateParams.
-SmallVector TemplateParamsReferencedInTemplateArgumentList(
+
@@ -1216,10 +1308,225 @@ void DeclareImplicitDeductionGuidesForTypeAlias(
->getDeductionCandidateKind() == DeductionCandidate::Aggregate)
continue;
-BuildDeductionGuideForTypeAlias(SemaRef, AliasTemplate, F, Loc);
+BuildDeductionGuideForTypeAlias(Sema
@@ -1216,10 +1328,280 @@ void DeclareImplicitDeductionGuidesForTypeAlias(
->getDeductionCandidateKind() == DeductionCandidate::Aggregate)
continue;
-BuildDeductionGuideForTypeAlias(SemaRef, AliasTemplate, F, Loc);
+BuildDeductionGuideForTypeAlias(Sema
1 - 100 of 186 matches
Mail list logo