@@ -757,23 +775,40 @@ bool Sema::CheckParameterPacksForExpansion(
bool HaveFirstPack = false;
std::optional NumPartialExpansions;
SourceLocation PartiallySubstitutedPackLoc;
+ typedef LocalInstantiationScope::DeclArgumentPack DeclArgumentPack;
for (UnexpandedParamet
@@ -15991,6 +15998,24 @@
TreeTransform::TransformFunctionParmPackExpr(FunctionParmPackExpr *E) {
return E;
}
+template
+ExprResult TreeTransform::TransformResolvedUnexpandedPackExpr(
+ResolvedUnexpandedPackExpr *E) {
+ bool ArgumentChanged = false;
+ SmallVector NewE
@@ -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/121314
___
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/123284
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -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 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
@@ -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
@@ -1166,26 +1166,54 @@
TemplateDeclInstantiator::VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D) {
Decl *TemplateDeclInstantiator::VisitBindingDecl(BindingDecl *D) {
auto *NewBD = BindingDecl::Create(SemaRef.Context, Owner, D->getLocation(),
-
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
@@ -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
@@ -1166,26 +1166,54 @@
TemplateDeclInstantiator::VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D) {
Decl *TemplateDeclInstantiator::VisitBindingDecl(BindingDecl *D) {
auto *NewBD = BindingDecl::Create(SemaRef.Context, Owner, D->getLocation(),
-
@@ -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;
zyn0217 wr
@@ -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
@@ -1166,26 +1166,54 @@
TemplateDeclInstantiator::VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D) {
Decl *TemplateDeclInstantiator::VisitBindingDecl(BindingDecl *D) {
auto *NewBD = BindingDecl::Create(SemaRef.Context, Owner, D->getLocation(),
-
@@ -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
__
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 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 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 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
@@ -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
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
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
zyn0217 wrote:
@mysterymath @zmodem Can you both test this patch on Windows to confirm if it
resolves issues you've reported? We'd greatly appreciate it!
https://github.com/llvm/llvm-project/pull/122423
___
cfe-commits mailing list
cfe-commits@lists.
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/7] Reapply "[Clang] Implement CWG2369 "Ordering between
constra
https://github.com/zyn0217 ready_for_review
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 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/6] Reapply "[Clang] Implement CWG2369 "Ordering between
constra
https://github.com/zyn0217 converted_to_draft
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 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/4] Reapply "[Clang] Implement CWG2369 "Ordering between
constra
https://github.com/zyn0217 closed
https://github.com/llvm/llvm-project/pull/122587
___
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/122587
___
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/122587
___
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/122587
Mold prefers the suffix '$' for symbols like PLT and GOT entries, so exclude
these symbols as well. Otherwise, this test will fail for developers using
mold-linked Clang.
>From 19467fe0e48abfe85003ebf80e29a37
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 ready_for_review
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 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 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/2] 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 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/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/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 converted_to_draft
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
zyn0217 wrote:
> Is kinda wrong, it should be in the instantiation of that function...
@erichkeane I don’t quite understand: the CWG issue itself requires us to check
the constraint before substituting into the function during template argument
deduction. So it shouldn’t live in a specializati
zyn0217 wrote:
Reverted in https://github.com/llvm/llvm-project/pull/122130
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 created
https://github.com/llvm/llvm-project/pull/122130
Unfortunately that breaks some code on Windows when lambdas come into play, as
reported in
https://github.com/llvm/llvm-project/pull/102857#issuecomment-2577861178
This reverts commit 96eced624e0f120155256033f
zyn0217 wrote:
I see the problem here:
When substituting into the constraint __is_derived_from_optional with [_Tp =
__sfinae_assign_base] prior to substituting the three-way operator, we must
also substitute into the lambda call expression. This requires instantiating
the lambda body to deduc
zyn0217 wrote:
@cor3ntin Do we need to revert it for now?
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 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 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 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/2] [Clang] Don't form a type constraint if the concept is
invali
Alejandro =?utf-8?q?Álvarez_Ayllón?=,
Alejandro =?utf-8?q?Álvarez_Ayllón?Message-ID:
In-Reply-To:
@@ -1228,35 +1228,45 @@ bool Sema::AttachTypeConstraint(AutoTypeLoc TL,
NonTypeTemplateParmDecl *NewConstrainedParm,
https://github.com/zyn0217 created
https://github.com/llvm/llvm-project/pull/122065
After 0dedd6fe1 and 03229e7c0, invalid concept declarations might lack
expressions for evaluation and normalization. This could make it crash in
certain scenarios, apart from the one of evaluation concepts show
https://github.com/zyn0217 approved this pull request.
Good catch, thanks!
https://github.com/llvm/llvm-project/pull/122055
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
zyn0217 wrote:
(I plan to merge this after the branch 20 cut to avoid any potential revert
churn. So it will stay in draft for now)
https://github.com/llvm/llvm-project/pull/121044
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.
https://github.com/zyn0217 approved this pull request.
Thanks, the patch looks great
https://github.com/llvm/llvm-project/pull/121785
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -174,6 +174,26 @@ static_assert(!__is_layout_compatible(StructWithAnonUnion,
StructWithAnonUnion3)
#endif
} // namespace cwg2759
+#if __cplusplus >= 202002L
+namespace cwg2770 { // cwg2770: 20
zyn0217 wrote:
Thanks for the post cleanup! Just learned how t
@@ -0,0 +1,54 @@
+// RUN: rm -rf %t
+// RUN: split-file %s %t
+// RUN: cd %t
+
+// RUN: %clang_cc1 -std=c++20 mod.cppm -emit-module-interface -o mod.pcm
-fallow-pcm-with-compiler-errors -verify
+// RUN: %clang_cc1 -std=c++20 main.cpp -fmodule-file=mod=mod.pcm -verify
-fallow-pcm
@@ -1235,15 +1235,24 @@ bool Sema::AttachTypeConstraint(AutoTypeLoc TL,
<< NewConstrainedParm->getTypeSourceInfo()
->getTypeLoc()
.getSourceRange();
+NewConstrainedParm->setPlaceholderTypeConstraint(
+RecoveryExpr::Create(Contex
@@ -174,6 +174,26 @@ static_assert(!__is_layout_compatible(StructWithAnonUnion,
StructWithAnonUnion3)
#endif
} // namespace cwg2759
+#if __cplusplus >= 202002L
+namespace cwg2770 { // cwg2770: 20
zyn0217 wrote:
Yes, I implemented what that issue proposed.
I
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
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 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 +,55 @@ bool Sema::EnsureTemplateArgumentListConstraints(
return false;
}
-bool Sema::CheckInstantiatedFunctionTemplateConstraints(
+static bool CheckFunctionConstraintsWithoutInstantiation(
+Sema &SemaRef, SourceLocation PointOfInstantiation,
+Functi
@@ -,12 +,55 @@ 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 +,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
@@ -,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)
@@ -6089,16 +6090,16 @@ bool
TreeTransform::TransformFunctionTypeParams(
const FunctionProtoType::ExtParameterInfo *ParamInfos,
SmallVectorImpl &OutParamTypes,
SmallVectorImpl *PVars,
-Sema::ExtParameterInfoBuilder &PInfos,
-unsigned *LastParamTransformed)
@@ -,12 +,57 @@ bool Sema::EnsureTemplateArgumentListConstraints(
return false;
}
-bool Sema::CheckInstantiatedFunctionTemplateConstraints(
+static bool CheckFunctionConstraintsWithoutInstantiation(
+Sema &SemaRef, SourceLocation PointOfInstantiation,
+Functi
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
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 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/5] [Clang] Diagnose unexpanded packs for NTTP type
constraints
https://github.com/zyn0217 commented:
Here is an interesting case involving lambda captures:
https://godbolt.org/z/Y7EhE7Gvq
(Everything would become scary when lambda comes into play)
https://github.com/llvm/llvm-project/pull/121417
___
cfe-commits
@@ -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
@@ -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
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/5] [Clang] Diagnose unexpanded packs for NTTP type
constraints
https://github.com/zyn0217 edited
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 edited
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/5] [Clang] Diagnose unexpanded packs for NTTP type
constraints
@@ -857,7 +857,8 @@ class PackDeductionScope {
if (auto *NTTP = dyn_cast(
TemplateParams->getParam(Index))) {
if (!NTTP->isExpandedParameterPack())
- if (auto *Expansion = dyn_cast(NTTP->getType()))
+ if (auto *Expansion = dyn_cast(
zyn0217 wrote:
@cor3ntin Do we still want to block on the getTemplateInstantiationArgs() stuff
or move forward anyway so we can (hopefully) have this in the upcoming clang
20? FWIW, this patch currently doesn't rely on the refactoring, using only a
ternary operand as a workaround for which it
@@ -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
@@ -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);
+//
@@ -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
@@ -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
@@ -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
@@ -757,23 +780,42 @@ bool Sema::CheckParameterPacksForExpansion(
bool HaveFirstPack = false;
std::optional NumPartialExpansions;
SourceLocation PartiallySubstitutedPackLoc;
+ typedef LocalInstantiationScope::DeclArgumentPack DeclArgumentPack;
for (UnexpandedParamet
@@ -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
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
1 - 100 of 1350 matches
Mail list logo