[clang] [clang] Implement P2582R1: CTAD from inherited constructors (PR #98788)
Shafik Yaghmour via cfe-commits
cfe-commits at lists.llvm.org
Sat Jul 13 20:27:08 PDT 2024
================
@@ -2157,17 +2157,19 @@ CXXDeductionGuideDecl *CXXDeductionGuideDecl::Create(
ASTContext &C, DeclContext *DC, SourceLocation StartLoc,
ExplicitSpecifier ES, const DeclarationNameInfo &NameInfo, QualType T,
TypeSourceInfo *TInfo, SourceLocation EndLocation, CXXConstructorDecl *Ctor,
- DeductionCandidate Kind) {
- return new (C, DC) CXXDeductionGuideDecl(C, DC, StartLoc, ES, NameInfo, T,
- TInfo, EndLocation, Ctor, Kind);
+ DeductionCandidate Kind, CXXDeductionGuideDecl *SourceDG,
+ bool IsGeneratedFromInheritedConstructor) {
+ return new (C, DC) CXXDeductionGuideDecl(
+ C, DC, StartLoc, ES, NameInfo, T, TInfo, EndLocation, Ctor, Kind,
+ SourceDG, IsGeneratedFromInheritedConstructor);
}
CXXDeductionGuideDecl *
CXXDeductionGuideDecl::CreateDeserialized(ASTContext &C, GlobalDeclID ID) {
return new (C, ID) CXXDeductionGuideDecl(
C, nullptr, SourceLocation(), ExplicitSpecifier(), DeclarationNameInfo(),
QualType(), nullptr, SourceLocation(), nullptr,
- DeductionCandidate::Normal);
+ DeductionCandidate::Normal, nullptr, false);
----------------
shafik wrote:
```suggestion
DeductionCandidate::Normal, /*SourceDG=*/nullptr, /*IsGeneratedFromInheritedConstructor =*/false);
```
This is based on [bugprone argument comment](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/argument-comment.html) convention.
https://github.com/llvm/llvm-project/pull/98788
More information about the cfe-commits
mailing list