[clang] [Clang] Improve error recovery for invalid calls (PR #136295)

2025-04-21 Thread Matheus Izvekov via cfe-commits
@@ -34,21 +34,22 @@ void test_invalid_call_1(int s) { int some_func2(int a, int b); void test_invalid_call_2() { - // CHECK: -RecoveryExpr {{.*}} 'int' contains-errors + // CHECK: -RecoveryExpr {{.*}} '' contains-errors mizvekov wrote: Okay, since this

[clang] [Clang] Improve error recovery for invalid calls (PR #136295)

2025-04-21 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. https://github.com/llvm/llvm-project/pull/136295 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] [Modules] Instantiate pending instantiations when GMF ends (PR #126842)

2025-02-19 Thread Matheus Izvekov via cfe-commits
@@ -1104,9 +1104,13 @@ void Sema::ActOnStartOfTranslationUnit() { } void Sema::ActOnEndOfTranslationUnitFragment(TUFragmentKind Kind) { - // No explicit actions are required at the end of the global module fragment. - if (Kind == TUFragmentKind::Global) + if (Kind == TUFrag

[clang] [Clang] Don't give up on an unsuccessful function instantiation (PR #126723)

2025-02-19 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @zyn0217 did you look into, and if so, would you mind including explanations on this part of the issue report: "Curiously, this bug seems to require a lambda -- if the lambda is replaced by an equivalent struct, the [bug disappears](https://godbolt.org/z/v8Wq4osh8). Also, a di

[clang] [libcxx] Reland: [clang] unified CWG2398 and P0522 changes; finishes implementation of P3310 (PR #124137)

2025-02-19 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov demilestoned https://github.com/llvm/llvm-project/pull/124137 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] disallow narrowing when matching template template parameters (PR #124313)

2025-02-19 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov demilestoned https://github.com/llvm/llvm-project/pull/124313 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] fix nondeduced mismatch with nullptr template arguments (PR #124498)

2025-02-19 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov demilestoned https://github.com/llvm/llvm-project/pull/124498 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] fix template argument conversion (PR #124386)

2025-02-19 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov demilestoned https://github.com/llvm/llvm-project/pull/124386 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] StmtPrinter: Handle DeclRefExpr to a Decomposition (PR #125001)

2025-02-19 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov demilestoned https://github.com/llvm/llvm-project/pull/125001 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] Reland: [clang] fix P3310 overload resolution flag propagation (PR #125791)

2025-02-19 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: /cherry-pick 08bda1cc6b0d2f1d31a89a76b5c154a11086c420 https://github.com/llvm/llvm-project/pull/125791 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [lldb][TypeSystemClang] Initialize ClassTemplateSpecializationDecl's StrictPackMatch field (PR #126215)

2025-02-19 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Cherry picking this onto the 20.x release branch requires https://github.com/llvm/llvm-project/pull/125791 to be cherry-picked first. https://github.com/llvm/llvm-project/pull/126215 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-19 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/125453 >From f7e2964999d5410a1f954e5142741e929f10f43e Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sun, 2 Feb 2025 23:47:15 -0300 Subject: [PATCH] [clang] print correct context for diagnostics suppressed by d

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-19 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/125453 >From 228d525709e5ba2fd9c8f929dc90db1ccbc915bb Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sun, 2 Feb 2025 23:47:15 -0300 Subject: [PATCH] [clang] print correct context for diagnostics suppressed by d

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-19 Thread Matheus Izvekov via cfe-commits
@@ -1909,7 +1909,19 @@ class Sema final : public SemaBase { /// '\#pragma clang attribute push' directives to the given declaration. void AddPragmaAttributes(Scope *S, Decl *D); - void PrintPragmaAttributeInstantiationPoint(); + using DiagFuncRef = mizve

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-19 Thread Matheus Izvekov via cfe-commits
@@ -1654,11 +1654,20 @@ void Sema::EmitDiagnostic(unsigned DiagID, const DiagnosticBuilder &DB) { } case DiagnosticIDs::SFINAE_Suppress: + if (DiagnosticsEngine::Level Level = getDiagnostics().getDiagnosticLevel( + DiagInfo.getID(), DiagInfo.getLocat

[clang] [C++20] [Modules] Instantiate pending instantiations when GMF ends (PR #126842)

2025-02-19 Thread Matheus Izvekov via cfe-commits
@@ -1104,9 +1104,13 @@ void Sema::ActOnStartOfTranslationUnit() { } void Sema::ActOnEndOfTranslationUnitFragment(TUFragmentKind Kind) { - // No explicit actions are required at the end of the global module fragment. - if (Kind == TUFragmentKind::Global) + if (Kind == TUFrag

[clang] [Clang] Don't give up on an unsuccessful function instantiation (PR #126723)

2025-02-18 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: Sorry that took a while, I am still coming back from WG21, so I can't look into this throughly yet. I would look into / want to know about the very specific requirements on hitting the bug, described in the bug report, such as the lambda vs struct thing.

[clang] [lldb] [lldb][TypeSystemClang] Initialize ClassTemplateSpecializationDecl's StrictPackMatch field (PR #126215)

2025-02-19 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: But there is reason to cherry-pick https://github.com/llvm/llvm-project/pull/125791, as it fixes a regression which would otherwise be introduced in 20.x. https://github.com/llvm/llvm-project/pull/126215 ___ cfe-commits mailing list c

[clang] [Clang] Implement P0963R3 "Structured binding declaration as a condition" (PR #130228)

2025-03-07 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: Looks good so far, thanks! https://github.com/llvm/llvm-project/pull/130228 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] [Modules] Instantiate pending instantiations when GMF ends (PR #126842)

2025-03-07 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM I can't follow up on this with a better suggestion right now, and I don't want to make the perfect the enemy of the good. https://github.com/llvm/llvm-project/pull/126842 ___ cfe-commits ma

[clang] [clang] fix matching of nested template template parameters (PR #130447)

2025-03-08 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/130447 When checking the template template parameters of template template parameters, the PartialOrdering context was not correctly propagated. This also has a few drive-by fixes, such as checking the template param

[clang] Change `ASTUnit::getASTContext() const` to return a non-const `ASTContext` (PR #130096)

2025-03-07 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: To put it another way, what do we want to prevent the user from accomplishing if he obtains a non-const reference to ASTContext from a const ASTUnit? https://github.com/llvm/llvm-project/pull/130096 ___ cfe-commits mailing list cfe-com

[clang] [clang] fix matching of nested template template parameters (PR #130447)

2025-03-09 Thread Matheus Izvekov via cfe-commits
@@ -11363,14 +11363,17 @@ class Sema final : public SemaBase { /// The context in which we are checking a template parameter list. enum TemplateParamListContext { -TPC_ClassTemplate, -TPC_VarTemplate, +// For this context, Class, Variable, TypeAlias, and non-pa

[clang] [clang] fix matching of nested template template parameters (PR #130447)

2025-03-09 Thread Matheus Izvekov via cfe-commits
@@ -11363,14 +11363,17 @@ class Sema final : public SemaBase { /// The context in which we are checking a template parameter list. enum TemplateParamListContext { -TPC_ClassTemplate, -TPC_VarTemplate, +// For this context, Class, Variable, TypeAlias, and non-pa

[clang] [clang] fix matching of nested template template parameters (PR #130447)

2025-03-09 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/130447 >From b225cdcfcb008ffa80b6f48476665980de66eac0 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sat, 8 Mar 2025 20:32:14 -0300 Subject: [PATCH] [clang] fix matching of nested template template parameters W

[clang] [clang] fix matching of nested template template parameters (PR #130447)

2025-03-09 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/130447 >From 0a41cc6f9e931df2a7dcbcf0ec35b2b7af8ad0d7 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sat, 8 Mar 2025 20:32:14 -0300 Subject: [PATCH] [clang] fix matching of nested template template parameters W

[clang] [clang] fix matching of nested template template parameters (PR #130447)

2025-03-09 Thread Matheus Izvekov via cfe-commits
@@ -11363,14 +11363,17 @@ class Sema final : public SemaBase { /// The context in which we are checking a template parameter list. enum TemplateParamListContext { -TPC_ClassTemplate, -TPC_VarTemplate, +// For this context, Class, Variable, TypeAlias, and non-pa

[clang] [clang][Sema] Improve template argument deduction diagnostic (PR #122754)

2025-03-09 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: This needs a rebase, I believe because of one of my patches. Just remove the call to 'S.NoteTemplateParameterLocation(*ParamD);', since that note is now emitted automatically. https://github.com/llvm/llvm-project/pull/122754 __

[clang] [clang][Sema] Improve template argument deduction diagnostic (PR #122754)

2025-03-09 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/122754 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Improve template argument deduction diagnostic (PR #122754)

2025-03-09 Thread Matheus Izvekov via cfe-commits
@@ -35,31 +35,27 @@ namespace ConstDestruction { constexpr ~D() { if (!can_destroy) -throw "oh no"; // expected-note {{subexpression not valid}} +throw "oh no"; } }; - template - void f() {} // expected-note 2{{invalid explicitly-specified

[clang] [clang][Sema] Improve template argument deduction diagnostic (PR #122754)

2025-03-09 Thread Matheus Izvekov via cfe-commits
@@ -3572,10 +3572,17 @@ TemplateDeductionResult Sema::SubstituteExplicitTemplateArguments( SugaredBuilder, CanonicalBuilder, /*UpdateArgsWithConversions=*/false) || Trap.hasErrorOccurred()) { + unsigned

[clang] Change `ASTUnit::getASTContext() const` to return a non-const `ASTContext` (PR #130096)

2025-03-06 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: There is no const_cast, or casting away const in any form on this patch, so how does it weaken const correctness? https://github.com/llvm/llvm-project/pull/130096 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.ll

[clang] [clang] Implement instantiation context note for checking template parameters (PR #126088)

2025-03-06 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed https://github.com/llvm/llvm-project/pull/126088 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement instantiation context note for checking template parameters (PR #126088)

2025-03-10 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Correction, I was thinking of a different PR. I did not test this PR on compile-time-tracker, as we didn't anticipate an impact. https://github.com/llvm/llvm-project/pull/126088 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] Reland: [clang] Implement evaluation context for checking template parameters (PR #130603)

2025-03-10 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Keeping in draft form while I investigate the performance regression reported here: https://github.com/llvm/llvm-project/pull/126088#issuecomment-2704874202 https://github.com/llvm/llvm-project/pull/130603 ___ cfe-commits mailing list

[clang] [clang] NNS: don't print trailing scope resolution operator in diagnostics (PR #130529)

2025-03-10 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed https://github.com/llvm/llvm-project/pull/130529 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] fix matching of nested template template parameters (PR #130447)

2025-03-09 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/130447 >From 78ac2f4cbc45c4f77aab5e28e3450e9c459b8077 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sat, 8 Mar 2025 20:32:14 -0300 Subject: [PATCH] [clang] fix matching of nested template template parameters W

[clang] [clang] NNS: don't print trailing scope resolution operator in diagnostics (PR #130529)

2025-03-09 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/130529 This clears up the printing of a NestedNameSpecifier so a trailing '::' is not printed, unless it refers into the global scope. This fixes a bunch of diagnostics where the trailing :: was awkward. This also p

[clang] [clang] NNS: don't print trailing scope resolution operator in diagnostics (PR #130529)

2025-03-10 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/130529 >From 7b6eae71bc2d102c1fa2472b83e16d6fae5640c1 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Fri, 7 Mar 2025 10:32:05 -0300 Subject: [PATCH] [clang] NNS: don't print trailing scope resolution operator T

[clang] [Clang] Implement P0963R3 "Structured binding declaration as a condition" (PR #130228)

2025-03-10 Thread Matheus Izvekov via cfe-commits
@@ -740,13 +740,16 @@ Sema::ActOnDecompositionDeclarator(Scope *S, Declarator &D, return nullptr; } - Diag(Decomp.getLSquareLoc(), - !getLangOpts().CPlusPlus17 - ? diag::ext_decomp_decl - : D.getContext() == DeclaratorContext::Condition -

[clang] [Clang] Implement P0963R3 "Structured binding declaration as a condition" (PR #130228)

2025-03-10 Thread Matheus Izvekov via cfe-commits
@@ -5452,6 +5477,11 @@ bool Compiler::visitSwitchStmt(const SwitchStmt *S) { if (!this->emitSetLocal(CondT, CondVar, S)) return false; + if (auto *DD = + dyn_cast_if_present(S->getConditionVariable())) +if (!this->emitDecompositionVarInit(DD)) + retur

[clang] [Clang] Implement P0963R3 "Structured binding declaration as a condition" (PR #130228)

2025-03-10 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/130228 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement P0963R3 "Structured binding declaration as a condition" (PR #130228)

2025-03-10 Thread Matheus Izvekov via cfe-commits
@@ -740,13 +740,16 @@ Sema::ActOnDecompositionDeclarator(Scope *S, Declarator &D, return nullptr; } - Diag(Decomp.getLSquareLoc(), - !getLangOpts().CPlusPlus17 - ? diag::ext_decomp_decl - : D.getContext() == DeclaratorContext::Condition -

[clang] [clang-tools-extra] [clang] improve class type sugar preservation in pointers to members (PR #130537)

2025-03-10 Thread Matheus Izvekov via cfe-commits
@@ -3524,14 +3524,16 @@ class MemberPointerType : public Type, public llvm::FoldingSetNode { QualType PointeeType; /// The class of which the pointee is a member. Must ultimately be a - /// RecordType, but could be a typedef or a template parameter too. - const Type *Cl

[clang] [clang] Implement instantiation context note for checking template parameters (PR #126088)

2025-03-10 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @nikic thanks for the report, I missed your message, only saw when Corentin pinged. Are you sure that's correct? I had run this patch through llvm-time-tracker before merging, and it had shown practically no impact. Here: https://llvm-compile-time-tracker.com/compare.php?from

[clang] [clang] Implement instantiation context note for checking template parameters (PR #126088)

2025-03-10 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: It's not exactly the same patch, had more changes on top, but the meat with the expected impact was the same. Anyway, thanks for the revert, will investigate. https://github.com/llvm/llvm-project/pull/126088 ___ cfe-commits mailing li

[clang] [clang-tools-extra] [clang] improve class type sugar preservation in pointers to members (PR #130537)

2025-03-10 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/130537 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement P0963R3 "Structured binding declaration as a condition" (PR #130228)

2025-03-10 Thread Matheus Izvekov via cfe-commits
@@ -5218,18 +5218,31 @@ static bool EvaluateVarDecl(EvalInfo &Info, const VarDecl *VD) { return true; } -static bool EvaluateDecl(EvalInfo &Info, const Decl *D) { - bool OK = true; +static bool EvaluateDecompositionDeclInit(EvalInfo &Info, +

[clang] [clang] Fix missing diagnostic of declaration use when accessing TypeDecls through typename access (PR #129681)

2025-03-10 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @zmodem Alright, I think this may have been the original bug, but you are the first to step in with a reproducer, thank you very much! https://github.com/llvm/llvm-project/pull/129681 ___ cfe-commits mailing list cfe-commits@lists.llv

[clang] [clang-tools-extra] [clang] improve class type sugar preservation in pointers to members (PR #130537)

2025-03-10 Thread Matheus Izvekov via cfe-commits
@@ -10033,15 +10040,24 @@ class Sema final : public SemaBase { bool InOverloadResolution, QualType &ConvertedType); + enum class CheckMemberPointerConversionResult { mizvekov wrote: Yes Check

[clang] [clang-tools-extra] [clang] improve class type sugar preservation in pointers to members (PR #130537)

2025-03-10 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > This patch ended up being pretty massive... ANYTHING we can do to reduce the > size of this would be very appreciated. It might be possible to split some stuff, but it would be hard to test it individually and avoid regressions in between the patches. https://github.com/llvm

[clang] [clang] NNS: don't print trailing scope resolution operator in diagnostics (PR #130529)

2025-03-11 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/130529 >From 87d712f87890d0a4fb4e782170e879b8397b4f69 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Fri, 7 Mar 2025 10:32:05 -0300 Subject: [PATCH] [clang] NNS: don't print trailing scope resolution operator T

[clang] [clang-tools-extra] [clang] improve class type sugar preservation in pointers to members (PR #130537)

2025-03-11 Thread Matheus Izvekov via cfe-commits
@@ -13461,13 +13486,112 @@ static ElaboratedTypeKeyword getCommonTypeKeyword(const T *X, const T *Y) { : ElaboratedTypeKeyword::None; } +static NestedNameSpecifier *getCommonNNS(ASTContext &Ctx, +

[clang] [clang-tools-extra] [clang] improve class type sugar preservation in pointers to members (PR #130537)

2025-03-11 Thread Matheus Izvekov via cfe-commits
@@ -5172,8 +5179,28 @@ QualType::DestructionKind QualType::isDestructedTypeImpl(QualType type) { return DK_none; } +bool MemberPointerType::isSugared() const { + CXXRecordDecl *D1 = getMostRecentCXXRecordDecl(), +*D2 = getQualifier()->getAsRecordDecl(); +

[clang] [clang-tools-extra] [clang] improve class type sugar preservation in pointers to members (PR #130537)

2025-03-11 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/130537 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] improve class type sugar preservation in pointers to members (PR #130537)

2025-03-11 Thread Matheus Izvekov via cfe-commits
@@ -13461,13 +13486,112 @@ static ElaboratedTypeKeyword getCommonTypeKeyword(const T *X, const T *Y) { : ElaboratedTypeKeyword::None; } +static NestedNameSpecifier *getCommonNNS(ASTContext &Ctx, +

[clang] [Clang] Implement P0963R3 "Structured binding declaration as a condition" (PR #130228)

2025-03-11 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM, sans a few nitty nits. Thanks! https://github.com/llvm/llvm-project/pull/130228 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [clang-tools-extra] [clang] improve class type sugar preservation in pointers to members (PR #130537)

2025-03-11 Thread Matheus Izvekov via cfe-commits
@@ -10033,15 +10040,24 @@ class Sema final : public SemaBase { bool InOverloadResolution, QualType &ConvertedType); + enum class CheckMemberPointerConversionResult { mizvekov wrote: Right but

[clang] [clang-tools-extra] [clang] improve class type sugar preservation in pointers to members (PR #130537)

2025-03-11 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: A dependent PR had been merged meanwhile, and this was not rebased. While this patch is still big, you might have been seeing way more stuff than was actually in the PR. I just rebased, but have not addressed any comments yet. https://github.com/llvm/llvm-project/pull/130537 _

[clang] [clang] NNS: don't print trailing scope resolution operator in diagnostics (PR #130529)

2025-03-11 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/130529 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Fix printing of large 64-bit unsigned template arguments (PR #129235)

2025-02-28 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov requested changes to this pull request. What problem is this trying to fix here? At first glance, I think it's a problem that we ast-print instantiations as explicit specializations. If we fix that, does your problem go away? Secondly, I agree that if we would print

[clang] [C++20] [Modules] Support generating in-class defined function with try-catch body (PR #129212)

2025-02-28 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: We could use a scope guard here to avoid the duplication, and this includes the pre-existing EOF handling. This would make this sort of bug more unlikely to happen in the future. https://github.com/llvm/llvm-project/pull/129212 ___

[clang] [clang][Sema] Improve template argument deduction diagnostic (PR #122754)

2025-03-11 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Sorry about that, but the patch which added the automatic `NoteTemplateParameterLocation` was reverted and I had missed the notification. https://github.com/llvm/llvm-project/pull/122754 ___ cfe-commits mailing list cfe-commits@lists.l

[clang] [clang] fix matching of nested template template parameters (PR #130447)

2025-03-11 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/130447 >From bcce55dcadd3eb57f9cd4e7cf26c5d4da71970cf Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sat, 8 Mar 2025 20:32:14 -0300 Subject: [PATCH] [clang] fix matching of nested template template parameters W

[clang] [Clang] Implement P0963R3 "Structured binding declaration as a condition" (PR #130228)

2025-03-11 Thread Matheus Izvekov via cfe-commits
@@ -5105,7 +5105,18 @@ bool Compiler::visitCompoundStmt(const CompoundStmt *S) { } template -bool Compiler::visitDeclStmt(const DeclStmt *DS) { +bool Compiler::emitDecompositionVarInit(const DecompositionDecl *DD) { + for (auto *BD : DD->bindings()) +if (auto *KD = BD->

[clang] [clang] NNS: don't print trailing scope resolution operator in diagnostics (PR #130529)

2025-03-11 Thread Matheus Izvekov via cfe-commits
@@ -599,16 +599,17 @@ def err_using_typename_non_type : Error< "'typename' keyword used on a non-type">; def err_using_dependent_value_is_type : Error< "dependent using declaration resolved to type without 'typename'">; -def err_using_decl_nested_name_specifier_is_not_class

[clang] [clang-tools-extra] [clang] improve class type sugar preservation in pointers to members (PR #130537)

2025-03-12 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I had already done so, it's practically no change: https://llvm-compile-time-tracker.com/compare.php?from=cce9f360b50ca5a95d5cb550e27a8f6757423460&to=20841e444c0f8d48c6c9d34a77fe48164f7ae728&stat=instructions:u https://github.com/llvm/llvm-project/pull/130537 ___

[clang] [clang] C++20 Modules: document how to perform automated reductions (PR #124997)

2025-03-05 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @cor3ntin do you sustain an objection due to the lack of a full beginner-friendly test case reduction tutorial? https://github.com/llvm/llvm-project/pull/124997 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm

[clang] [clang] Implement instantiation context note for checking template parameters (PR #126088)

2025-03-05 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Ping. I'll merge tomorrow if there are no further objections. https://github.com/llvm/llvm-project/pull/126088 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] [Modules] Support generating in-class defined function with try-catch body (PR #129212)

2025-03-04 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. Perfect, TYVM! https://github.com/llvm/llvm-project/pull/129212 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] [Modules] Support generating in-class defined function with try-catch body (PR #129212)

2025-03-04 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > > Thanks, LGTM. > > With just a little more effort you could add the EOF stuff in there too. > > What do you mean by EOF stuff? It seems you can deduplicate by moving this block into the scope guard: ```C++ while (Tok.isNot(tok::eof)) ConsumeAnyToken(); if

[clang] [clang] fix matching of nested template template parameters (PR #130447)

2025-03-11 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed https://github.com/llvm/llvm-project/pull/130447 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] improve class type sugar preservation in pointers to members (PR #130537)

2025-03-11 Thread Matheus Izvekov via cfe-commits
@@ -5172,8 +5179,28 @@ QualType::DestructionKind QualType::isDestructedTypeImpl(QualType type) { return DK_none; } +bool MemberPointerType::isSugared() const { + CXXRecordDecl *D1 = getMostRecentCXXRecordDecl(), +*D2 = getQualifier()->getAsRecordDecl(); +

[clang] [Clang] Implement CWG2918 'Consideration of constraints for address of overloaded function' (PR #127773)

2025-02-19 Thread Matheus Izvekov via cfe-commits
@@ -13252,6 +13273,33 @@ class AddressOfFunctionResolver { } } + void EliminateLessPartialOrderingConstrainedMatches() { +// C++ [over.over]p5: +// [...] Any given non-template function F0 is eliminated if the set +// contains a second non-template funct

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-19 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @cor3ntin ping https://github.com/llvm/llvm-project/pull/125453 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] [Modules] Instantiate pending instantiations when GMF ends (PR #126842)

2025-02-19 Thread Matheus Izvekov via cfe-commits
@@ -1104,9 +1104,13 @@ void Sema::ActOnStartOfTranslationUnit() { } void Sema::ActOnEndOfTranslationUnitFragment(TUFragmentKind Kind) { - // No explicit actions are required at the end of the global module fragment. - if (Kind == TUFragmentKind::Global) + if (Kind == TUFrag

[clang] [clang][Sema] Improve template argument deduction diagnostic (PR #122754)

2025-02-20 Thread Matheus Izvekov via cfe-commits
@@ -11714,27 +11714,51 @@ static void DiagnoseBadDeduction(Sema &S, NamedDecl *Found, Decl *Templated, return; } - case TemplateDeductionResult::InvalidExplicitArguments: + case TemplateDeductionResult::InvalidExplicitArguments: { assert(ParamD && "no parameter f

[clang] [clang][Sema] Improve template argument deduction diagnostic (PR #122754)

2025-02-20 Thread Matheus Izvekov via cfe-commits
@@ -11714,27 +11714,51 @@ static void DiagnoseBadDeduction(Sema &S, NamedDecl *Found, Decl *Templated, return; } - case TemplateDeductionResult::InvalidExplicitArguments: + case TemplateDeductionResult::InvalidExplicitArguments: { assert(ParamD && "no parameter f

[clang] [clang][Sema] Improve template argument deduction diagnostic (PR #122754)

2025-02-20 Thread Matheus Izvekov via cfe-commits
@@ -3572,10 +3572,17 @@ TemplateDeductionResult Sema::SubstituteExplicitTemplateArguments( SugaredBuilder, CanonicalBuilder, /*UpdateArgsWithConversions=*/false) || Trap.hasErrorOccurred()) { + unsigned

[clang] [clang][Sema] Improve template argument deduction diagnostic (PR #122754)

2025-02-20 Thread Matheus Izvekov via cfe-commits
@@ -4870,14 +4870,17 @@ def note_ovl_candidate_inconsistent_deduction_types : Note< "candidate template ignored: deduced values %diff{" "of conflicting types for parameter %0 (%1 of type $ vs. %3 of type $)|" "%1 and %3 of conflicting types for parameter %0}2,4">;

[clang] [clang] Implement instantiation context note for checking template parameters (PR #126088)

2025-02-20 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/126088 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-20 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed https://github.com/llvm/llvm-project/pull/125453 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement instantiation context note for checking template parameters (PR #126088)

2025-02-20 Thread Matheus Izvekov via cfe-commits
@@ -5294,10 +5294,14 @@ def err_template_missing_args : Error< "%select{class template|function template|variable template|alias template|" "template template parameter|concept|template}0 %1 requires template " "arguments">; -def err_template_arg_list_different_arity : Er

[clang] [clang] Implement instantiation context note for checking template parameters (PR #126088)

2025-02-20 Thread Matheus Izvekov via cfe-commits
@@ -11802,9 +11817,10 @@ class Sema final : public SemaBase { bool PartialOrdering, bool *StrictPackMatch); + SmallString<128> toTerseString(const NamedDecl &D) const; mizvekov wrote:

[clang] [clang] Implement instantiation context note for checking template parameters (PR #126088)

2025-02-20 Thread Matheus Izvekov via cfe-commits
@@ -5294,10 +5294,14 @@ def err_template_missing_args : Error< "%select{class template|function template|variable template|alias template|" "template template parameter|concept|template}0 %1 requires template " "arguments">; -def err_template_arg_list_different_arity : Er

[clang] [clang][Sema] Fix initialization of `NonTypeTemplateParmDecl`... (PR #121768)

2025-02-20 Thread Matheus Izvekov via cfe-commits
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?=, 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ó

[clang] [clang] Implement instantiation context note for checking template parameters (PR #126088)

2025-02-26 Thread Matheus Izvekov via cfe-commits
@@ -5294,10 +5294,14 @@ def err_template_missing_args : Error< "%select{class template|function template|variable template|alias template|" "template template parameter|concept|template}0 %1 requires template " "arguments">; -def err_template_arg_list_different_arity : Er

[clang] [clang][Sema] Improve template argument deduction diagnostic (PR #122754)

2025-02-25 Thread Matheus Izvekov via cfe-commits
@@ -3572,10 +3572,17 @@ TemplateDeductionResult Sema::SubstituteExplicitTemplateArguments( SugaredBuilder, CanonicalBuilder, /*UpdateArgsWithConversions=*/false) || Trap.hasErrorOccurred()) { + unsigned

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-03-30 Thread Matheus Izvekov via cfe-commits
@@ -7353,6 +7354,69 @@ void Sema::CheckCompletedCXXClass(Scope *S, CXXRecordDecl *Record) { else if (Record->hasAttr()) checkCUDADeviceBuiltinTextureClassTemplate(*this, Record); } + + llvm::SmallVector TypeAwareNewDecls; + llvm::SmallVector TypeAwareDeleteDecls;

[clang] Disable alias template CTAD for C++17 (PR #133597)

2025-03-29 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: It is generally ok, we only do not allow it when that would cause some significant backwards compatibility issues. https://github.com/llvm/llvm-project/pull/133597 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

[clang] Disable alias template CTAD for C++17 (PR #133597)

2025-03-29 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: We do tend to offer newer features into older standards when that isn't a burden, as long as we have a warning advertising the incompatibility with the current standard, as we do. What is the motivation for this change? https://github.com/llvm/llvm-proje

[clang] [clang] implement common-sugar for adjusted member-pointers (PR #133613)

2025-03-29 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/133613 This implements a missing case for an adjusted member-pointer in getCommonSugaredType, when that was originally implemented here: https://github.com/llvm/llvm-project/pull/130537 This missing case could other

[clang] [clang-tools-extra] [lldb] Reland: [clang] preserve class type sugar when taking pointer to member (PR #132401)

2025-03-29 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @alexfh should be fixed by https://github.com/llvm/llvm-project/pull/133613 https://github.com/llvm/llvm-project/pull/132401 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[clang] Disable alias template CTAD for C++17 (PR #133597)

2025-03-29 Thread Matheus Izvekov via cfe-commits
@@ -9895,26 +9895,30 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (!Template) { if (auto *AliasTemplate = dyn_cast_or_null( TemplateName.getAsTemplateDecl())) { - Diag(Kind.getLocation(), - diag::warn_cxx17_compat_ctad_for_

[clang] Disable alias template CTAD for C++17 (PR #133597)

2025-03-29 Thread Matheus Izvekov via cfe-commits
@@ -113,7 +113,7 @@ namespace dependent { }; template void f() { typename T::X tx = 0; -typename T::Y ty = 0; +typename T::template Y ty = 0; mizvekov wrote: This is just removing the test. Ideally this would still be tested under C++20. https

[clang] [clang] remove unused frontend flag -fretain_subst_template_type_parm_type_ast_nodes (PR #134177)

2025-04-02 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/134177 This is a follow-up to #132748, where we deferred the flag removal in order to ease transition for external users. The plan is to merge this in the nearish future, in two weeks or so is my best guess. >From

[clang] [clang] Track final substitution for Subst* AST nodes (PR #132748)

2025-04-02 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed https://github.com/llvm/llvm-project/pull/132748 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [clang] WIP: Improved Context Declaration tracking (PR #107942)

2025-04-04 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov 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

[clang] [Clang] Fix various bugs in alias CTAD transform (PR #132061)

2025-04-04 Thread Matheus Izvekov via cfe-commits
@@ -1650,6 +1665,23 @@ namespace { return inherited::TransformTemplateArgument(Input, Output, Uneval); } +std::optional ComputeSizeOfPackExprWithoutSubstitution( +ArrayRef PackArgs) { + // Don't do this when rewriting template parameters for CTAD: +

[clang] [libc] [clang] diagnose invalid member pointer class on instantiation (PR #132516)

2025-03-21 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/132516 This moves the diagnostic for member pointers pointing into non-class into BuildMemberPointer, so that it can be used from RebuildMemberPointer, when instantiating templates. Also adds a minor tweak to the di

<    10   11   12   13   14   15   16   17   >