@@ -8499,23 +8498,63 @@ Decl *Sema::ActOnConceptDefinition(
NewDecl->setInvalidDecl();
}
+ DeclarationNameInfo NameInfo(NewDecl->getDeclName(), NewDecl->getBeginLoc());
+ LookupResult Previous(*this, NameInfo, LookupOrdinaryName,
+forRedeclarati
https://github.com/zyn0217 closed
https://github.com/llvm/llvm-project/pull/110887
___
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/110842
___
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/110887
___
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/110887
Otherwise, we would probably have an unmatched instantiated declaration for
init-captures when they come after a non-init capture.
No release note because the bug only affects the trunk.
Fixes #110721
>From 0
https://github.com/zyn0217 created
https://github.com/llvm/llvm-project/pull/110842
This addresses comments from @Endilll in the post commit review of #110473.
>From 5660d1ee7f5b815061f04e2f77eb1abced041ea6 Mon Sep 17 00:00:00 2001
From: Younan Zhang
Date: Wed, 2 Oct 2024 21:41:53 +0800
Subje
zyn0217 wrote:
@Endilll Filed https://github.com/llvm/llvm-project/pull/110842 for your
comments. PTAL, thanks!
https://github.com/llvm/llvm-project/pull/110473
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mai
@@ -29,6 +29,35 @@ namespace std {
#endif
} // namespace std
+namespace cwg2707 { // cwg2707: 20
+
+#if __cplusplus >= 202002L
+
+template struct A { // #cwg2707-A
+ T value[N];
+};
+
+template
+A(T...) -> A requires (sizeof...(T) == 2); //
#cwg2707-guide-A
+
+// Brace eli
https://github.com/zyn0217 updated
https://github.com/llvm/llvm-project/pull/110842
>From 5660d1ee7f5b815061f04e2f77eb1abced041ea6 Mon Sep 17 00:00:00 2001
From: Younan Zhang
Date: Wed, 2 Oct 2024 21:41:53 +0800
Subject: [PATCH 1/2] [Clang][NFC] Rearrange tests for CWG 2707 after #110473
---
@@ -444,7 +444,7 @@ const RawComment *ASTContext::getRawCommentForAnyRedecl(
return CommentlessRedeclChains.lookup(CanonicalD);
}();
- for (const auto Redecl : D->redecls()) {
+ for (const auto Redecl : CanonicalD->redecls()) {
zyn0217 wrote:
I reread
zyn0217 wrote:
> @zyn0217 should all the commits be squashed into one?
Of course.
By saying “flesh out the commit message”, I meant to edit the PR description on
github, which would become the final commit message when we merge the PR.
https://github.com/llvm/llvm-project/pull/113777
zyn0217 wrote:
BTW, can you flesh out the commit message so we don't just have a single issue
link there? Thanks
https://github.com/llvm/llvm-project/pull/113777
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/ma
https://github.com/zyn0217 edited
https://github.com/llvm/llvm-project/pull/112381
___
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.
LG modulo one question. Thanks for the prompt fix.
https://github.com/llvm/llvm-project/pull/112381
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/li
@@ -2085,7 +2085,9 @@ class ClassTemplateSpecializationDecl : public
CXXRecordDecl,
class ClassTemplatePartialSpecializationDecl
: public ClassTemplateSpecializationDecl {
/// The list of template parameters
- TemplateParameterList* TemplateParams = nullptr;
+ TemplatePa
https://github.com/zyn0217 approved this pull request.
LGTM as well, thanks for working on it!
https://github.com/llvm/llvm-project/pull/113777
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-
https://github.com/zyn0217 updated
https://github.com/llvm/llvm-project/pull/114220
>From 782caa155a746e7170f1794972b07d28fcf80692 Mon Sep 17 00:00:00 2001
From: Younan Zhang
Date: Wed, 30 Oct 2024 20:35:33 +0800
Subject: [PATCH 1/3] [Clang] Distinguish expanding-packs-in-place cases for
Subst
https://github.com/zyn0217 updated
https://github.com/llvm/llvm-project/pull/114220
>From 782caa155a746e7170f1794972b07d28fcf80692 Mon Sep 17 00:00:00 2001
From: Younan Zhang
Date: Wed, 30 Oct 2024 20:35:33 +0800
Subject: [PATCH 1/2] [Clang] Distinguish expanding-packs-in-place cases for
Subst
@@ -1736,23 +1736,13 @@ namespace {
SourceLocation RParenLoc,
std::optional Length,
ArrayRef PartialArgs) {
- if (SemaRef.CodeSynthesisContexts.back().Kind !=
-
@@ -1881,6 +1871,15 @@ Decl *TemplateInstantiator::TransformDecl(SourceLocation
Loc, Decl *D) {
TemplateArgument Arg = TemplateArgs(TTP->getDepth(), TTP->getPosition());
if (TTP->isParameterPack()) {
+// We might not have an index for pack expansion when n
https://github.com/zyn0217 closed
https://github.com/llvm/llvm-project/pull/114220
___
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/115120
>From 0017e08259472b4397c8be5578da33448e3d82cd Mon Sep 17 00:00:00 2001
From: Younan Zhang
Date: Wed, 6 Nov 2024 13:51:01 +0800
Subject: [PATCH 1/2] [Clang] Remove the wrong assumption when rebuilding
SizeOfPac
@@ -1736,23 +1736,13 @@ namespace {
SourceLocation RParenLoc,
std::optional Length,
ArrayRef PartialArgs) {
- if (SemaRef.CodeSynthesisContexts.back().Kind !=
-
@@ -1731,31 +1731,21 @@ namespace {
return inherited::TransformLambdaBody(E, Body);
}
-ExprResult RebuildSizeOfPackExpr(SourceLocation OperatorLoc,
- NamedDecl *Pack, SourceLocation PackLoc,
-
https://github.com/zyn0217 closed
https://github.com/llvm/llvm-project/pull/115120
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
zyn0217 wrote:
Further reduced to:
```cpp
struct CacheRequestImpl {
friend void LoadOrRun(CacheRequestImpl, int = 42) {}
};
void CacheRequestTests_MakesCacheKey_TestTestBody() {
CacheRequestImpl req;
LoadOrRun(req);
}
```
There is no template in this case, so obviously,
`FDecl->getMember
@@ -33,7 +33,7 @@ template typename TT> struct E { //
expected-note 2{{template
};
A(int) -> int; // expected-error {{deduced type 'int' of deduction guide is
not a specialization of template 'A'}}
-template A(T)->B; // expected-error {{deduced type
'B' (aka 'A') o
@@ -11451,7 +11451,11 @@ bool Sema::CheckDeductionGuideDeclarator(Declarator
&D, QualType &R,
bool MightInstantiateToSpecialization = false;
if (auto RetTST =
TSI->getTypeLoc().getAsAdjusted()) {
- TemplateName SpecifiedName = RetTST.getTypePtr()->getT
https://github.com/zyn0217 approved this pull request.
LGTM modulo a release note.
https://github.com/llvm/llvm-project/pull/117345
___
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/118050
This aligns with the logic in `TreeTransform::RebuildQualifiedType()` where we
refrain from adding const qualifiers to function types. Previously, we seemed
to overlook this edge case when copy-capturing a vari
https://github.com/zyn0217 edited
https://github.com/llvm/llvm-project/pull/117841
___
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, while I haven’t come up with a better solution to model this situation,
I think this looks good for now.
Please give @cor3ntin some time before merging, in case there are some better
approaches that I might have overlooked.
https:
@@ -1639,11 +1639,19 @@ SourceLocation CallExpr::getBeginLoc() const {
if (const auto *OCE = dyn_cast(this))
return OCE->getBeginLoc();
+ if (const auto *Method =
+ dyn_cast_if_present(getCalleeDecl());
zyn0217 wrote:
nit: I presume the `const
https://github.com/zyn0217 approved this pull request.
https://github.com/llvm/llvm-project/pull/118041
___
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/117947
___
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/117947
___
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/118050
___
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/115487
___
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.
LGTM modulo 1 nit.
@mizvekov are you happy with it?
https://github.com/llvm/llvm-project/pull/115487
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/l
@@ -185,3 +185,46 @@ template struct S {
friend void X::f(T::type);
};
}
+
+namespace GH113324 {
+template struct S1 {
+ friend void f1(S1, int = 0); // expected-error {{friend declaration
specifying a default argument must be a definition}}
+ friend void f2(S1 a, S1 = de
https://github.com/zyn0217 edited
https://github.com/llvm/llvm-project/pull/115487
___
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/117296
___
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/116782
Substituting into pack indexing types/expressions can still result in
unexpanded types/expressions, such as PackIndexingType or PackIndexingExpr. To
handle these cases correctly, we should defer the pack size c
https://github.com/zyn0217 edited
https://github.com/llvm/llvm-project/pull/116782
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -65,7 +64,7 @@ int main() {
}
-namespace GH11460 {
+namespace GH111460 {
zyn0217 wrote:
That was a typo. The patch -
https://github.com/llvm/llvm-project/commit/1ad5f315ae1cd44369a72cc8dc44fc9ef0cbe638#diff-64f7b2e488768fb71e127d736dc81d9d817ec14b759a8ec
https://github.com/zyn0217 ready_for_review
https://github.com/llvm/llvm-project/pull/116332
___
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/116332
This patch makes cases `void f(T... [N])` valid and adds a warning where the
parameter is not of a pack indexing but of a pack expansion type, as per
https://eel.is/c++draft/diff#cpp23.dcl.dcl-2.
Fixes https:/
@@ -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
@@ -3705,6 +3713,12 @@ bool Parser::ParseExpressionList(SmallVectorImpl
&Exprs,
Token Comma = Tok;
ConsumeToken();
checkPotentialAngleBracketDelimiter(Comma);
+
+if (Tok.is(tok::r_paren)) {
+ if (HasTrailingComma)
+*HasTrailingComma = true;
+
@@ -583,6 +583,8 @@ Improvements to Clang's diagnostics
- For an rvalue reference bound to a temporary struct with an integer member,
Clang will detect constant integer overflow
in the initializer for the integer member (#GH46755).
+- Clang now prevents errors for deduction
@@ -12,6 +12,31 @@ void g() {
}
}
+namespace GH113324 {
+struct S1 {
+ friend void f1(S1, int = 42) {}
+};
+
+template using __enable_if_t = int;
zyn0217 wrote:
I think you should at least remove these unrelated things in the test: they
contributed nothing
zyn0217 wrote:
Thanks you all for the feedback. So I'm going to keep it invalid and just add a
warning for clarity.
https://github.com/llvm/llvm-project/pull/116332
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin
https://github.com/zyn0217 updated
https://github.com/llvm/llvm-project/pull/116332
>From 5973de1d4c368a26fd179954a13de94595f35575 Mon Sep 17 00:00:00 2001
From: Younan Zhang
Date: Fri, 15 Nov 2024 14:09:14 +0800
Subject: [PATCH 1/3] [Clang][Parser] Make 'T...[N]' within a function
parameter a
https://github.com/zyn0217 edited
https://github.com/llvm/llvm-project/pull/116332
___
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/116332
>From 5973de1d4c368a26fd179954a13de94595f35575 Mon Sep 17 00:00:00 2001
From: Younan Zhang
Date: Fri, 15 Nov 2024 14:09:14 +0800
Subject: [PATCH 1/4] [Clang][Parser] Make 'T...[N]' within a function
parameter a
https://github.com/zyn0217 edited
https://github.com/llvm/llvm-project/pull/116332
___
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/118176
The NTTP argument appearing inside a trailing return type of a generic lambda
would have to check for potential lambda captures, where the function needs
GLTemplateParameterList of the current LSI to tell wheth
zyn0217 wrote:
Sorry, it might be I forgot to save the changes before I ran the tests
yesterday!
I looked into it again, and I think I have begun to understand
`TemplateParameterListsInfo`:
The first intent is to describe out-of-line member functions that live in a
templated scope. For examp
https://github.com/zyn0217 edited
https://github.com/llvm/llvm-project/pull/108142
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
zyn0217 wrote:
Sadly I think I should figure out a way to remove reliance on the refactoring
work of `getTemplateInstantiationArgs()`, as it is still unstable at this point.
https://github.com/llvm/llvm-project/pull/102857
___
cfe-commits mailing list
https://github.com/zyn0217 updated
https://github.com/llvm/llvm-project/pull/116332
>From 5973de1d4c368a26fd179954a13de94595f35575 Mon Sep 17 00:00:00 2001
From: Younan Zhang
Date: Fri, 15 Nov 2024 14:09:14 +0800
Subject: [PATCH 1/2] [Clang][Parser] Make 'T...[N]' within a function
parameter a
zyn0217 wrote:
> > @cor3ntin Not much, we just need to move the handling of the friend
> > declaration outside of `getTemplateInstantiationArgs()` :)
>
> >
>
> > Do you see any other outstanding issues? If not, can we go ahead with the
> > status quo so we have sufficient timeframe in clang
https://github.com/zyn0217 updated
https://github.com/llvm/llvm-project/pull/116782
>From 5c0d947576b692c32febf89703033715b0c51cda Mon Sep 17 00:00:00 2001
From: Younan Zhang
Date: Tue, 19 Nov 2024 18:33:34 +0800
Subject: [PATCH 1/2] [Clang] Preserve partially substituted pack indexing
type/ex
https://github.com/zyn0217 closed
https://github.com/llvm/llvm-project/pull/116782
___
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/117345
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -717,6 +717,8 @@ Bug Fixes to C++ Support
- Clang now uses valid deduced type locations when diagnosing functions with
trailing return type
missing placeholder return type. (#GH78694)
- Fixed a bug where bounds of partially expanded pack indexing expressions
were checked
https://github.com/zyn0217 ready_for_review
https://github.com/llvm/llvm-project/pull/118176
___
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/118176
___
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/118176
>From 6d55d79dc7a67a94be0f72b15f8da90813ebb9fd Mon Sep 17 00:00:00 2001
From: Younan Zhang
Date: Sat, 30 Nov 2024 23:23:47 +0800
Subject: [PATCH 1/2] [Clang] Recover GLTemplateParameterList for generic
lambdas
zyn0217 wrote:
thanks for the review :)
https://github.com/llvm/llvm-project/pull/118176
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
zyn0217 wrote:
@sdkrystian Friendly ping. Any chance for you to reapply this patch recently?
thanks
https://github.com/llvm/llvm-project/pull/115159
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinf
https://github.com/zyn0217 ready_for_review
https://github.com/llvm/llvm-project/pull/119123
___
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/119123
Closes #119072
>From 7ea2b4c5a9042aeb77982e3f5bb03af36de23c96 Mon Sep 17 00:00:00 2001
From: Younan Zhang
Date: Sun, 8 Dec 2024 18:17:46 +0800
Subject: [PATCH] [Clang] Recurse into parsing when using pack-index
https://github.com/zyn0217 edited
https://github.com/llvm/llvm-project/pull/119123
___
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/119123
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -247,18 +242,23 @@ getGenericLambdaTemplateParameterList(LambdaScopeInfo
*LSI, Sema &SemaRef) {
CXXRecordDecl *
Sema::createLambdaClosureType(SourceRange IntroducerRange, TypeSourceInfo
*Info,
- unsigned LambdaDependencyKind,
-
https://github.com/zyn0217 edited
https://github.com/llvm/llvm-project/pull/107942
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zyn0217 commented:
I took another pass through the code, and it looks good overall.
Given the scale of this patch, input from others would be valuable. It would be
nice if you could move the patch out of draft status to get more visibility :)
https://github.com/llvm/llvm-pro
@@ -17658,8 +17662,49 @@ HandleImmediateInvocations(Sema &SemaRef,
}
}
+static void setContextDecl(Sema &S, Decl *Base, Decl *ContextDecl) {
+ switch (Base->getKind()) {
+ case Decl::CXXRecord: {
+auto *RD = cast(Base);
+RD->setLambdaContextDecl(ContextDecl);
+
@@ -7946,6 +7980,8 @@ class Sema final : public SemaBase {
/// A stack of expression evaluation contexts.
SmallVector ExprEvalContexts;
+ SmallVector PendingLazyContextDecls;
zyn0217 wrote:
So from a quick reading, PendingLazyContextDecls is used for lam
@@ -8494,10 +8495,21 @@ DeclResult Sema::ActOnClassTemplateSpecialization(
return Specialization;
}
-Decl *Sema::ActOnTemplateDeclarator(Scope *S,
- MultiTemplateParamsArg TemplateParameterLists,
-Declarator &D
@@ -17658,8 +17662,49 @@ HandleImmediateInvocations(Sema &SemaRef,
}
}
+static void setContextDecl(Sema &S, Decl *Base, Decl *ContextDecl) {
+ switch (Base->getKind()) {
+ case Decl::CXXRecord: {
+auto *RD = cast(Base);
+RD->setLambdaContextDecl(ContextDecl);
+
https://github.com/zyn0217 approved this pull request.
Thanks
https://github.com/llvm/llvm-project/pull/118948
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -,12 +,57 @@ bool Sema::EnsureTemplateArgumentListConstraints(
return false;
}
-bool Sema::CheckInstantiatedFunctionTemplateConstraints(
+static bool CheckFunctionConstraintsWithoutInstantiation(
+Sema &SemaRef, SourceLocation PointOfInstantiation,
+Functi
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
@@ -6089,16 +6090,16 @@ bool
TreeTransform::TransformFunctionTypeParams(
const FunctionProtoType::ExtParameterInfo *ParamInfos,
SmallVectorImpl &OutParamTypes,
SmallVectorImpl *PVars,
-Sema::ExtParameterInfoBuilder &PInfos,
-unsigned *LastParamTransformed)
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
@@ -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
@@ -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
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 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
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
@@ -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(
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
@@ -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(
@@ -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
@@ -1235,15 +1235,24 @@ bool Sema::AttachTypeConstraint(AutoTypeLoc TL,
<< NewConstrainedParm->getTypeSourceInfo()
->getTypeLoc()
.getSourceRange();
+NewConstrainedParm->setPlaceholderTypeConstraint(
+RecoveryExpr::Create(Contex
@@ -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
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
1201 - 1300 of 2066 matches
Mail list logo