https://github.com/zyn0217 edited
https://github.com/llvm/llvm-project/pull/123667
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zyn0217 approved this pull request.
Thanks!
https://github.com/llvm/llvm-project/pull/123533
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -977,6 +977,7 @@ Bug Fixes to C++ Support
- Fix immediate escalation not propagating through inherited constructors.
(#GH112677)
- Fixed assertions or false compiler diagnostics in the case of C++ modules for
lambda functions or inline friend functions defined inside tem
https://github.com/zyn0217 closed
https://github.com/llvm/llvm-project/pull/123533
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -13464,6 +13464,14 @@ Decl *Sema::ActOnAliasDeclaration(Scope *S,
AccessSpecifier AS,
}
TemplateParameterList *TemplateParams = TemplateParamLists[0];
+// Check shadowing of a template parameter name
+for (NamedDecl *TP : TemplateParams->asArray()) {
+
@@ -13464,6 +13464,14 @@ Decl *Sema::ActOnAliasDeclaration(Scope *S,
AccessSpecifier AS,
}
TemplateParameterList *TemplateParams = TemplateParamLists[0];
+// Check shadowing of a template parameter name
+for (NamedDecl *TP : TemplateParams->asArray()) {
+
@@ -15991,6 +15998,24 @@
TreeTransform::TransformFunctionParmPackExpr(FunctionParmPackExpr *E) {
return E;
}
+template
+ExprResult TreeTransform::TransformResolvedUnexpandedPackExpr(
+ResolvedUnexpandedPackExpr *E) {
+ bool ArgumentChanged = false;
+ SmallVector NewE
@@ -757,23 +775,40 @@ bool Sema::CheckParameterPacksForExpansion(
bool HaveFirstPack = false;
std::optional NumPartialExpansions;
SourceLocation PartiallySubstitutedPackLoc;
+ typedef LocalInstantiationScope::DeclArgumentPack DeclArgumentPack;
for (UnexpandedParamet
https://github.com/zyn0217 approved this pull request.
Just a thought from my side, but not required at the moment because this aims
to be as simple as possible. Otherwise LGTM
https://github.com/llvm/llvm-project/pull/123551
___
cfe-commits mailing l
https://github.com/zyn0217 edited
https://github.com/llvm/llvm-project/pull/123551
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -422,7 +425,15 @@ std::vector
HeuristicResolverImpl::resolveDependentMember(
if (!RD->hasDefinition())
return {};
RD = RD->getDefinition();
-return lookupDependentName(RD, Name, Filter);
+return lookupDependentName(RD, Name, [&](const NamedDecl *ND) {
@@ -191,4 +192,4 @@ int g = sfinae_me(); // expected-error{{no matching
function for call to 's
namespace NullExceptionDecl {
template auto get = []() { try { } catch(...) {}; return I; }; //
expected-error{{initializer contains unexpanded parameter pack 'I'}}
-}
+}
@@ -13464,6 +13464,14 @@ Decl *Sema::ActOnAliasDeclaration(Scope *S,
AccessSpecifier AS,
}
TemplateParameterList *TemplateParams = TemplateParamLists[0];
+// Check shadowing of a template parameter name
+for (NamedDecl *TP : TemplateParams->asArray()) {
+
https://github.com/zyn0217 closed
https://github.com/llvm/llvm-project/pull/122875
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
zyn0217 wrote:
> There is something generally wrong with type aliases which don't use all of
> their parameters, and this needs more thought.
The current approach - bubbling up the containsUnexpanded flag within a
transform - is admittedly not ideal. However, it's the only way to make Clang
c
Alejandro =?utf-8?q?Álvarez_Ayllón?=,
Alejandro =?utf-8?q?Álvarez_Ayllón?=,
Alejandro =?utf-8?q?Álvarez_Ayllón?=,
Alejandro =?utf-8?q?Álvarez_Ayllón?Message-ID:
In-Reply-To:
@@ -1983,15 +1983,17 @@ void
ASTDeclWriter::VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D) {
@@ -15991,6 +15998,24 @@
TreeTransform::TransformFunctionParmPackExpr(FunctionParmPackExpr *E) {
return E;
}
+template
+ExprResult TreeTransform::TransformResolvedUnexpandedPackExpr(
+ResolvedUnexpandedPackExpr *E) {
+ bool ArgumentChanged = false;
+ SmallVector NewE
https://github.com/zyn0217 approved this pull request.
Thanks
https://github.com/llvm/llvm-project/pull/124468
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zyn0217 created
https://github.com/llvm/llvm-project/pull/124533
We used to always transform the pattern declaration for SizeOfPackExpr to
ensure the constraint expression's profile produced the desired result.
However, this approach failed to handle pack expansions when the
https://github.com/zyn0217 edited
https://github.com/llvm/llvm-project/pull/124533
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zyn0217 updated
https://github.com/llvm/llvm-project/pull/124533
>From b195bfb253df84ea315eb92a59bbae2401b0248f Mon Sep 17 00:00:00 2001
From: Younan Zhang
Date: Mon, 27 Jan 2025 19:48:43 +0800
Subject: [PATCH 1/2] [Clang] Remove unnecessary Decl transform & profiles for
Siz
https://github.com/zyn0217 commented:
Hmm, I'm unfamiliar with the libcxx/LLVM demangler part, but it does look like
we're duplicating something. Can anyone explain why we have to do that?
https://github.com/llvm/llvm-project/pull/123513
___
cfe-commi
@@ -1003,6 +1003,7 @@ Bug Fixes to C++ Support
lambda functions or inline friend functions defined inside templates
(#GH122493).
- Clang now rejects declaring an alias template with the same name as its
template parameter. (#GH123423)
- Correctly determine the implicit cons
@@ -4787,6 +4788,7 @@ void CXXNameMangler::mangleRequirement(SourceLocation
RequiresExprLoc,
void CXXNameMangler::mangleExpression(const Expr *E, unsigned Arity,
bool AsTemplateArg) {
+ // clang-format off
zyn0217 wrote:
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-linux-gnu -std=c++2a |
FileCheck %s
+
+namespace spaceship {
+ struct X {};
+ struct Y {};
+ int operator<=>(X, Y);
+
+ // CHECK-LABEL: define {{.*}}
@_ZN9spaceship1fIiEEvDTcmltcvNS_1YE_EcvNS_1XE_EcvT__EE
https://github.com/zyn0217 edited
https://github.com/llvm/llvm-project/pull/123513
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -133,8 +133,8 @@ TemplateName getReferencedTemplateName(const Type *T) {
CXXRecordDecl *HeuristicResolverImpl::resolveTypeToRecordDecl(const Type *T) {
assert(T);
- // Unwrap type sugar such as type aliases.
- T = T->getCanonicalTypeInternal().getTypePtr();
+ // Unwrap
https://github.com/zyn0217 approved this pull request.
Thanks, the changes LGTM. I'll help you merge it if there are no other comments
within today.
https://github.com/llvm/llvm-project/pull/124491
___
cfe-commits mailing list
cfe-commits@lists.llvm.o
https://github.com/zyn0217 approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/124515
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -5284,8 +5284,22 @@ void Sema::InstantiateFunctionDefinition(SourceLocation
PointOfInstantiation,
savedContext.pop();
}
- DeclGroupRef DG(Function);
- Consumer.HandleTopLevelDecl(DG);
+ // With CWG2369, we substitute constraints before instantiating the
associate
https://github.com/zyn0217 created
https://github.com/llvm/llvm-project/pull/124572
This is taken from
https://github.com/llvm/llvm-project/pull/122423#discussion_r1930102632 as
suggested by Corentin.
Fixes #82926
>From f515e670d35365f14f063e02eb10cd41e3751937 Mon Sep 17 00:00:00 2001
From:
https://github.com/zyn0217 closed
https://github.com/llvm/llvm-project/pull/124533
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zyn0217 approved this pull request.
https://github.com/llvm/llvm-project/pull/124675
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -389,11 +390,11 @@ bool findOrdinaryMember(const CXXRecordDecl *RD,
CXXBasePath &Path,
bool HeuristicResolverImpl::findOrdinaryMemberInDependentClasses(
const CXXBaseSpecifier *Specifier, CXXBasePath &Path,
DeclarationName Name) {
- CXXRecordDecl *RD =
- resol
https://github.com/zyn0217 edited
https://github.com/llvm/llvm-project/pull/124699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zyn0217 approved this pull request.
One nit, else LGTM
https://github.com/llvm/llvm-project/pull/124699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
zyn0217 wrote:
@shafik @AaronBallman Here is the complete backstory:
We were not performing well in out-of-line concept comparison, especially for
expressions involving packs. I tried to address these issues around commit
04d20b170, but it quickly became evident that the fix was insufficient f
https://github.com/zyn0217 closed
https://github.com/llvm/llvm-project/pull/123883
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zyn0217 approved this pull request.
Looks great, thanks
https://github.com/llvm/llvm-project/pull/121315
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -248,6 +248,25 @@ ExprResult Parser::ParseArrayBoundExpression() {
// If we parse the bound of a VLA... we parse a non-constant
// constant-expression!
Actions.ExprEvalContexts.back().InConditionallyConstantEvaluateContext =
true;
+ // For a VLA type inside an uneval
https://github.com/zyn0217 updated
https://github.com/llvm/llvm-project/pull/123883
>From 5427c748811041d0878dc4aec8b7b37c4241af37 Mon Sep 17 00:00:00 2001
From: Younan Zhang
Date: Tue, 21 Jan 2025 20:21:20 +0800
Subject: [PATCH 1/3] [Clang] SubstituteConstraintExpressionWithoutSatisfaction
ne
@@ -248,6 +248,25 @@ ExprResult Parser::ParseArrayBoundExpression() {
// If we parse the bound of a VLA... we parse a non-constant
// constant-expression!
Actions.ExprEvalContexts.back().InConditionallyConstantEvaluateContext =
true;
+ // For a VLA type inside an uneval
https://github.com/zyn0217 approved this pull request.
Neat!
https://github.com/llvm/llvm-project/pull/124888
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zyn0217 edited
https://github.com/llvm/llvm-project/pull/122423
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zyn0217 created
https://github.com/llvm/llvm-project/pull/122875
We should have been checking desugar() for the type of the right-hand side of a
typedef declaration, instead of using getCanonicalType(), which points to the
end of the type alias chain.
Fixes https://github.c
@@ -810,7 +810,7 @@ Bug Fixes to C++ Support
module imports in those situations. (#GH60336)
- Fix init-capture packs having a size of one before being instantiated.
(#GH63677)
- Clang now preserves the unexpanded flag in a lambda transform used for pack
expansion. (#GH56852
@@ -7331,18 +7332,33 @@ void Parser::ParseDecompositionDeclarator(Declarator
&D) {
Diag(Tok, diag::err_expected_comma_or_rsquare);
}
-SkipUntil(tok::r_square, tok::comma, tok::identifier,
- StopAtSemi | StopBeforeMatch);
+//
zyn0217 wrote:
Thanks so much for the review! I'll keep an eye on that PR, and there’s some
post-work to do: 1. Cleanup 2. Adaptation for lambdas
https://github.com/llvm/llvm-project/pull/102857
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/zyn0217 closed
https://github.com/llvm/llvm-project/pull/102857
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zyn0217 updated
https://github.com/llvm/llvm-project/pull/121296
>From 102e031cae56c130f48f08bcb316b6f451facf49 Mon Sep 17 00:00:00 2001
From: Younan Zhang
Date: Sun, 29 Dec 2024 23:13:52 +0800
Subject: [PATCH 1/6] [Clang] Diagnose unexpanded packs for NTTP type
constraints
https://github.com/zyn0217 closed
https://github.com/llvm/llvm-project/pull/121296
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -,12 +,55 @@ bool Sema::EnsureTemplateArgumentListConstraints(
return false;
}
-bool Sema::CheckInstantiatedFunctionTemplateConstraints(
+static bool CheckFunctionConstraintsWithoutInstantiation(
+Sema &SemaRef, SourceLocation PointOfInstantiation,
+Functi
https://github.com/zyn0217 edited
https://github.com/llvm/llvm-project/pull/102857
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zyn0217 edited
https://github.com/llvm/llvm-project/pull/102857
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -,12 +,55 @@ bool Sema::EnsureTemplateArgumentListConstraints(
return false;
}
-bool Sema::CheckInstantiatedFunctionTemplateConstraints(
+static bool CheckFunctionConstraintsWithoutInstantiation(
+Sema &SemaRef, SourceLocation PointOfInstantiation,
+Functi
@@ -,12 +,57 @@ bool Sema::EnsureTemplateArgumentListConstraints(
return false;
}
-bool Sema::CheckInstantiatedFunctionTemplateConstraints(
+static bool CheckFunctionConstraintsWithoutInstantiation(
+Sema &SemaRef, SourceLocation PointOfInstantiation,
+Functi
@@ -13044,6 +13045,17 @@ class Sema final : public SemaBase {
bool SkipForSpecialization = false,
bool ForDefaultArgumentSubstitution = false);
+ /// Apart from storing the result to \p Result, this behaves the same as
+ /// another overload.
+ void getTemplateI
@@ -13044,6 +13045,17 @@ class Sema final : public SemaBase {
bool SkipForSpecialization = false,
bool ForDefaultArgumentSubstitution = false);
+ /// Apart from storing the result to \p Result, this behaves the same as
+ /// another overload.
+ void getTemplateI
@@ -,12 +,55 @@ bool Sema::EnsureTemplateArgumentListConstraints(
return false;
}
-bool Sema::CheckInstantiatedFunctionTemplateConstraints(
+static bool CheckFunctionConstraintsWithoutInstantiation(
+Sema &SemaRef, SourceLocation PointOfInstantiation,
+Functi
@@ -,12 +,57 @@ bool Sema::EnsureTemplateArgumentListConstraints(
return false;
}
-bool Sema::CheckInstantiatedFunctionTemplateConstraints(
+static bool CheckFunctionConstraintsWithoutInstantiation(
+Sema &SemaRef, SourceLocation PointOfInstantiation,
+Functi
@@ -,12 +,57 @@ bool Sema::EnsureTemplateArgumentListConstraints(
return false;
}
-bool Sema::CheckInstantiatedFunctionTemplateConstraints(
+static bool CheckFunctionConstraintsWithoutInstantiation(
+Sema &SemaRef, SourceLocation PointOfInstantiation,
+Functi
@@ -6089,16 +6090,16 @@ bool
TreeTransform::TransformFunctionTypeParams(
const FunctionProtoType::ExtParameterInfo *ParamInfos,
SmallVectorImpl &OutParamTypes,
SmallVectorImpl *PVars,
-Sema::ExtParameterInfoBuilder &PInfos,
-unsigned *LastParamTransformed)
https://github.com/zyn0217 closed
https://github.com/llvm/llvm-project/pull/121405
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zyn0217 ready_for_review
https://github.com/llvm/llvm-project/pull/121296
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zyn0217 updated
https://github.com/llvm/llvm-project/pull/121296
>From 102e031cae56c130f48f08bcb316b6f451facf49 Mon Sep 17 00:00:00 2001
From: Younan Zhang
Date: Sun, 29 Dec 2024 23:13:52 +0800
Subject: [PATCH 1/4] [Clang] Diagnose unexpanded packs for NTTP type
constraints
https://github.com/zyn0217 converted_to_draft
https://github.com/llvm/llvm-project/pull/121296
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zyn0217 ready_for_review
https://github.com/llvm/llvm-project/pull/123022
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zyn0217 created
https://github.com/llvm/llvm-project/pull/123022
We missed a case of type constraints referencing deduced template parameters
when constructing a deduction guide for the type alias. This patch fixes the
issue by swapping the order of constructing 'template ar
https://github.com/zyn0217 updated
https://github.com/llvm/llvm-project/pull/123022
>From 549216ee8a58c8b60fcbc757e1b7041b5ef2da54 Mon Sep 17 00:00:00 2001
From: Younan Zhang
Date: Wed, 15 Jan 2025 15:25:20 +0800
Subject: [PATCH 1/2] [Clang] Correct the order of substituted arguments in
CTAD a
https://github.com/zyn0217 updated
https://github.com/llvm/llvm-project/pull/123022
>From 549216ee8a58c8b60fcbc757e1b7041b5ef2da54 Mon Sep 17 00:00:00 2001
From: Younan Zhang
Date: Wed, 15 Jan 2025 15:25:20 +0800
Subject: [PATCH 1/2] [Clang] Correct the order of substituted arguments in
CTAD a
https://github.com/zyn0217 closed
https://github.com/llvm/llvm-project/pull/123022
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zyn0217 approved this pull request.
Thanks!
https://github.com/llvm/llvm-project/pull/123209
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zyn0217 updated
https://github.com/llvm/llvm-project/pull/122423
>From d40a80859eafe96bdc99957db2aebb70db407e67 Mon Sep 17 00:00:00 2001
From: Younan Zhang
Date: Fri, 10 Jan 2025 09:46:24 +0800
Subject: [PATCH 1/5] Reapply "[Clang] Implement CWG2369 "Ordering between
constra
https://github.com/zyn0217 updated
https://github.com/llvm/llvm-project/pull/122423
>From d40a80859eafe96bdc99957db2aebb70db407e67 Mon Sep 17 00:00:00 2001
From: Younan Zhang
Date: Fri, 10 Jan 2025 09:46:24 +0800
Subject: [PATCH 1/3] Reapply "[Clang] Implement CWG2369 "Ordering between
constra
https://github.com/zyn0217 approved this pull request.
https://github.com/llvm/llvm-project/pull/123284
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -47,6 +49,10 @@ template void f() {
}(), ...);
}(1, 2);
+ [](Is...) {
+([] { using T = ElementType; }(), ...);
zyn0217 wrote:
Yes, that's exactly why the issue arises.
https://github.com/llvm/llvm-project/pull/122875
__
@@ -1166,26 +1166,54 @@
TemplateDeclInstantiator::VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D) {
Decl *TemplateDeclInstantiator::VisitBindingDecl(BindingDecl *D) {
auto *NewBD = BindingDecl::Create(SemaRef.Context, Owner, D->getLocation(),
-
@@ -951,28 +959,125 @@ Sema::ActOnDecompositionDeclarator(Scope *S, Declarator
&D,
return New;
}
+// CheckBindingsCount
+// - Checks the arity of the structured bindings
+// - Creates the resolved pack expr if there is
+//one
+
zyn0217 wrote:
```sugg
@@ -757,23 +775,40 @@ bool Sema::CheckParameterPacksForExpansion(
bool HaveFirstPack = false;
std::optional NumPartialExpansions;
SourceLocation PartiallySubstitutedPackLoc;
+ typedef LocalInstantiationScope::DeclArgumentPack DeclArgumentPack;
zyn0217 wr
@@ -15991,6 +15998,24 @@
TreeTransform::TransformFunctionParmPackExpr(FunctionParmPackExpr *E) {
return E;
}
+template
+ExprResult TreeTransform::TransformResolvedUnexpandedPackExpr(
+ResolvedUnexpandedPackExpr *E) {
+ bool ArgumentChanged = false;
+ SmallVector NewE
@@ -1166,26 +1166,54 @@
TemplateDeclInstantiator::VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D) {
Decl *TemplateDeclInstantiator::VisitBindingDecl(BindingDecl *D) {
auto *NewBD = BindingDecl::Create(SemaRef.Context, Owner, D->getLocation(),
-
@@ -50,17 +50,29 @@ class CollectUnexpandedParameterPacksVisitor
auto *FTD = FD ? FD->getDescribedFunctionTemplate() : nullptr;
if (FTD && FTD->getTemplateParameters()->getDepth() >= DepthLimit)
return;
- } else if (getDepthAndIndex(ND).first >= D
@@ -757,23 +775,40 @@ bool Sema::CheckParameterPacksForExpansion(
bool HaveFirstPack = false;
std::optional NumPartialExpansions;
SourceLocation PartiallySubstitutedPackLoc;
+ typedef LocalInstantiationScope::DeclArgumentPack DeclArgumentPack;
for (UnexpandedParamet
https://github.com/zyn0217 commented:
Thanks, this looks much better now. I went through another pass, focusing
mostly on the pack expansion part.
https://github.com/llvm/llvm-project/pull/121417
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
@@ -1166,26 +1166,54 @@
TemplateDeclInstantiator::VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D) {
Decl *TemplateDeclInstantiator::VisitBindingDecl(BindingDecl *D) {
auto *NewBD = BindingDecl::Create(SemaRef.Context, Owner, D->getLocation(),
-
@@ -1508,23 +1612,52 @@ static bool checkMemberDecomposition(Sema &S,
ArrayRef Bindings,
Qualifiers Q = DecompType.getQualifiers();
if (FD->isMutable())
Q.removeConst();
-B->setBinding(S.BuildQualifiedType(FD->getType(), Loc, Q), E.get());
+Walker.commitA
https://github.com/zyn0217 edited
https://github.com/llvm/llvm-project/pull/121417
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zyn0217 approved this pull request.
Thanks
https://github.com/llvm/llvm-project/pull/121314
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zyn0217 updated
https://github.com/llvm/llvm-project/pull/122065
>From 312776183068b84ddfea38ea7158c44c1926160a Mon Sep 17 00:00:00 2001
From: Younan Zhang
Date: Wed, 8 Jan 2025 15:40:23 +0800
Subject: [PATCH 1/3] [Clang] Don't form a type constraint if the concept is
invali
https://github.com/zyn0217 closed
https://github.com/llvm/llvm-project/pull/122065
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zyn0217 ready_for_review
https://github.com/llvm/llvm-project/pull/121296
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -951,28 +959,130 @@ Sema::ActOnDecompositionDeclarator(Scope *S, Declarator
&D,
return New;
}
+namespace {
+// CheckBindingsCount
+// - Checks the arity of the structured bindings
+// - Creates the resolved pack expr if there is
+//one
+bool CheckBindingsCount(Sema
@@ -757,23 +780,42 @@ bool Sema::CheckParameterPacksForExpansion(
bool HaveFirstPack = false;
std::optional NumPartialExpansions;
SourceLocation PartiallySubstitutedPackLoc;
+ typedef LocalInstantiationScope::DeclArgumentPack DeclArgumentPack;
for (UnexpandedParamet
@@ -210,6 +229,10 @@ class CollectUnexpandedParameterPacksVisitor
bool TraversePackIndexingTypeLoc(PackIndexingTypeLoc TL) override {
return DynamicRecursiveASTVisitor::TraverseStmt(TL.getIndexExpr());
}
+bool
+TraverseResolvedUnexpandedPackExpr(ResolvedUn
@@ -422,8 +445,8 @@ Sema::DiagnoseUnexpandedParameterPacks(SourceLocation Loc,
if (const TemplateTypeParmType *TTP
= Unexpanded[I].first.dyn_cast())
Name = TTP->getIdentifier();
-else
- Name = cast(Unexpanded[I].first)->getIdentifier();
+else if
@@ -50,16 +51,28 @@ class CollectUnexpandedParameterPacksVisitor
auto *FTD = FD ? FD->getDescribedFunctionTemplate() : nullptr;
if (FTD && FTD->getTemplateParameters()->getDepth() >= DepthLimit)
return;
- } else if (getDepthAndIndex(ND).first >= D
@@ -15991,6 +15991,13 @@
TreeTransform::TransformFunctionParmPackExpr(FunctionParmPackExpr *E) {
return E;
}
+template
+ExprResult TreeTransform::TransformResolvedUnexpandedPackExpr(
+ResolvedUnexpandedPackExpr *E) {
+ // Default behavior is to do nothing with this tr
https://github.com/zyn0217 commented:
Thanks for working on this. I left some comments, and I think we need more
tests for contexts e.g. templated member functions/nested dependent lambdas to
test the state machine in TreeTransform, apart from @cor3ntin's request.
Moreover, you may need to bui
https://github.com/zyn0217 edited
https://github.com/llvm/llvm-project/pull/121417
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,82 @@
+// RUN: %clang_cc1 -fsyntax-only -std=c++2b %s -verify
+// expected-no-diagnostics
+
+template
+struct type_ { };
+
+template
+auto sum(T... t) { return (t + ...); }
+
+struct my_struct {
+ int a;
+ int b;
+ int c;
+ int d;
+};
+
+struct fake
1401 - 1500 of 2066 matches
Mail list logo