[clang] Reapply "[Clang] Improve diagnostics for expansion length mismatch" (PR #121044)

2025-01-07 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM, though I would have preferred to keep the patches separate, it's less of a revert risk. https://github.com/llvm/llvm-project/pull/121044 ___ cfe-commits mailing list cfe-commits@lists.llvm.

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

2025-01-07 Thread Matheus Izvekov via cfe-commits
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,

[clang] Reland: [clang] Track function template instantiation from definition (PR #125266)

2025-02-03 Thread Matheus Izvekov via cfe-commits
@@ -2298,6 +2298,13 @@ class FunctionDecl : public DeclaratorDecl, FunctionDeclBits.IsLateTemplateParsed = ILT; } + bool isInstantiatedFromMemberTemplate() const { +return FunctionDeclBits.IsInstantiatedFromMemberTemplate; + } + void setInstantiatedFromMemberTempl

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

2025-02-03 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 = + llvm::function_

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

2025-02-03 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 = + llvm::function_

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

2025-02-03 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/125453 >From ff34c10553ed645fc8277cb72247f6cb67a024e6 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-03 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Thank you for tackling this longstanding issue! How much does saving this > extra state add to the runtime and memory usage on a template-heavy > compilation? I tried building stdexec, the difference is within the noise. Do you have any other examples of template-heavy code i

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

2025-02-03 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] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-03 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-03 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 = + llvm::function_

[clang] Reland: [clang] Track function template instantiation from definition (PR #125266)

2025-02-03 Thread Matheus Izvekov via cfe-commits
@@ -2298,6 +2298,13 @@ class FunctionDecl : public DeclaratorDecl, FunctionDeclBits.IsLateTemplateParsed = ILT; } + bool isInstantiatedFromMemberTemplate() const { +return FunctionDeclBits.IsInstantiatedFromMemberTemplate; + } + void setInstantiatedFromMemberTempl

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

2025-01-30 Thread Matheus Izvekov via cfe-commits
@@ -11714,27 +11714,44 @@ 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-01-30 Thread Matheus Izvekov via cfe-commits
@@ -4870,14 +4870,16 @@ 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] Track function template instantiation from definition (PR #112241)

2025-01-30 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Thanks for the report, this is the reduced reproducer: ```C++ template struct QWindowSystemHelper { template static void handleEvent() { QWindowSystemHelper::handleEvent(); } }; template <> template void QWindowSystemHelper::handleEvent() { static_assert(__is_same(Eve

[clang] [clang] fix P3310 overload resolution flag propagation (PR #125372)

2025-02-04 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > well Thanks, I won't be able to for the next few hours. If it's not trivial to fix, please go ahead and revert. https://github.com/llvm/llvm-project/pull/125372 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

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

2025-02-04 Thread Matheus Izvekov via cfe-commits
@@ -280,7 +280,8 @@ std::optional CxxModuleHandler::tryInstantiateStdTemplate(Decl *d) { new_class_template->getDeclContext(), new_class_template->getTemplatedDecl()->getLocation(), new_class_template->getLocation(), new_class_template, imported_args, -

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

2025-02-04 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > it's a permitted point of instantiation; we could try it and see if it works > well enough in practice. We could also delay implicit definitions of special > members like we do for template instantiations to reduce the impact. Another possibility would be only saving the cont

[clang] [clang] fix P3310 overload resolution flag propagation (PR #125372)

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

[clang] [clang] NFC: rename MatchedPackOnParmToNonPackOnArg to StrictPackMatch (PR #125418)

2025-02-04 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/125418 ___ 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-01-31 Thread Matheus Izvekov via cfe-commits
@@ -4870,14 +4870,16 @@ 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] C++20 Modules: document how to perform automated reductions (PR #124997)

2025-01-31 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Yes, we don't have a generic document on automated reduction without modules. The idea of this document here is to inform developers who already know how to perform such reductions, so that they can target modules as well. The key piece of information here that surprises most p

[clang] Reland: [clang] Track function template instantiation from definition (PR #125266)

2025-01-31 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > I’m not in a position where I can test the patch properly right now, but if > the whole qtbase can be built (not only the reduced testcase or the specific > source file that triggered the issue before), I’m good with it - thanks! Yes it does, no problem! https://github.com/l

[clang] Reland: [clang] Track function template instantiation from definition (PR #125266)

2025-01-31 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/125266 This fixes instantiation of definition for friend function templates, when the declaration found and the one containing the definition have different template contexts. In these cases, the the function declarat

[clang] Reland: [clang] Track function template instantiation from definition (PR #125266)

2025-01-31 Thread Matheus Izvekov via cfe-commits
@@ -5276,9 +5277,31 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation, RebuildTypeSourceInfoForDefaultSpecialMembers(); SetDeclDefaulted(Function, PatternDecl->getLocation()); } else { +NamedDecl *ND = Function; +DeclContext *DC

[clang] [clang] NFC: rename MatchedPackOnParmToNonPackOnArg to StrictPackMatch (PR #125418)

2025-02-04 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Yeah this is just a bad automatic rebase by GitHub, only the top commit is relevant. https://github.com/llvm/llvm-project/pull/125418 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

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

2025-02-05 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed 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] Reland: [clang] Track function template instantiation from definition (PR #125266)

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

[clang] Reland: [clang] Track function template instantiation from definition (PR #125266)

2025-02-07 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: /cherry-pick 346077aaa6bef5652a72a2f3d9fc134ea8fc6a5b https://github.com/llvm/llvm-project/pull/125266 ___ 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-07 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov milestoned 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-07 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov milestoned https://github.com/llvm/llvm-project/pull/126215 ___ 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-07 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov milestoned 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] Reland: [clang] Track function template instantiation from definition (PR #125266)

2025-02-07 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov milestoned https://github.com/llvm/llvm-project/pull/125266 ___ 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-07 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov milestoned 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] [libcxx] Reland: [clang] unified CWG2398 and P0522 changes; finishes implementation of P3310 (PR #124137)

2025-02-07 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov milestoned 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] [libcxx] Reland: [clang] unified CWG2398 and P0522 changes; finishes implementation of P3310 (PR #124137)

2025-02-07 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: /cherry-pick 28ad8978ee2054298d4198bf10c8cb68730af037 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] fix template argument conversion (PR #124386)

2025-02-07 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov milestoned 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] [lldb] Reland: [clang] fix P3310 overload resolution flag propagation (PR #125791)

2025-02-06 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Actually, @mizvekov, can we make the > `ClassTemplateSpecializationDecl::ClassTemplateSpecializationDecl(ASTContext > &C, Kind DK)` constructor default initialize the `StrictPackMatch` member to > false? In that case users of `CreateDeserialized` wouldn't need to worry > abo

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

2025-02-06 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > > > > > Actually, @mizvekov, can we make the > > > > > `ClassTemplateSpecializationDecl::ClassTemplateSpecializationDecl(ASTContext > > > > > &C, Kind DK)` constructor default initialize the `StrictPackMatch` > > > > > member to false? In that case users of `CreateDeserialize

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

2025-02-06 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > > > Actually, @mizvekov, can we make the > > > `ClassTemplateSpecializationDecl::ClassTemplateSpecializationDecl(ASTContext > > > &C, Kind DK)` constructor default initialize the `StrictPackMatch` > > > member to false? In that case users of `CreateDeserialized` wouldn't need

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

2025-02-05 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/125453 >From adde9f1f8eabe4d98ba09fd978f8d152a9865347 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-05 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 = + llvm::function_

[clang] [lldb] [clang] NFC: rename MatchedPackOnParmToNonPackOnArg to StrictPackMatch (PR #125418)

2025-02-05 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/125418 >From 29c48b0785af13572a785f90747529ffe7a572ed Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sun, 2 Feb 2025 13:31:20 -0300 Subject: [PATCH] [clang] NFC: rename MatchedPackOnParmToNonPackOnArg to Strict

[clang] [clang] fix P3310 overload resolution flag propagation (PR #125372)

2025-02-05 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Probably best to pass a constant `false`/`true` to preserve old behaviour. We > can't even instantiate templates in the expression evaluator right now, so > don't think we should be worrying about this at the moment Please see https://github.com/llvm/llvm-project/pull/125791

[clang] [lldb] [clang] NFC: rename MatchedPackOnParmToNonPackOnArg to StrictPackMatch (PR #125418)

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

[clang] [lldb] [clang] NFC: rename MatchedPackOnParmToNonPackOnArg to StrictPackMatch (PR #125418)

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

[clang] Reland: [clang] Track function template instantiation from definition (PR #125266)

2025-02-05 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/125266 >From 1282f6a3181fa37e8649e407fabd72893a01103a Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sat, 28 Sep 2024 14:28:58 -0300 Subject: [PATCH] [clang] Track function template instantiation from definition

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

2025-02-05 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: https://llvm-compile-time-tracker.com/compare.php?from=4eab2194872d54e2d4496135a277b1610ff33ead&to=adde9f1f8eabe4d98ba09fd978f8d152a9865347&stat=instructions:u These performance results don't indicate an impact either. https://github.com/llvm/llvm-project/pull/125453 ___

[clang] Revert "[HLSL] Implement HLSL Flat casting (excluding splat cases)" (PR #126149)

2025-02-06 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Hi, We usually ask to include the reason for the revert in the commit message. https://github.com/llvm/llvm-project/pull/126149 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

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

2025-02-07 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. https://github.com/llvm/llvm-project/pull/126215 ___ 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-06 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/125453 >From a36dcb035a30b560eb9dd14fd3ce2f8e8952b8ee 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] [C++20] [Modules] Instantiate pending instantiations when GMF ends (PR #126842)

2025-02-12 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] fix P3310 overload resolution flag propagation (PR #125372)

2025-02-02 Thread Matheus Izvekov via cfe-commits
@@ -2525,8 +2525,11 @@ void TextNodeDumper::VisitCXXRecordDecl(const CXXRecordDecl *D) { OS << " instantiated_from"; dumpPointer(Instance); } - if (const auto *CTSD = dyn_cast(D)) + if (const auto *CTSD = dyn_cast(D)) { dumpTemplateSpecializationKind(CTSD->get

[clang] [clang] fix P3310 overload resolution flag propagation (PR #125372)

2025-02-02 Thread Matheus Izvekov via cfe-commits
@@ -1841,15 +1841,21 @@ class ClassTemplateSpecializationDecl : public CXXRecordDecl, LLVM_PREFERRED_TYPE(TemplateSpecializationKind) unsigned SpecializationKind : 3; + /// When matching the primary template, have we matched any packs on the + /// parameter side, versus

[clang] [clang] fix P3310 overload resolution flag propagation (PR #125372)

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

[clang] [clang] fix P3310 overload resolution flag propagation (PR #125372)

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

[clang] [clang] fix P3310 overload resolution flag propagation (PR #125372)

2025-02-02 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/125372 >From a624adeb9a0b0af5c9370c6a97b2e2c874cdc066 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Fri, 31 Jan 2025 20:41:39 -0300 Subject: [PATCH] [clang] fix P3310 overload resolution flag propagation Class

[clang] [clang] fix P3310 overload resolution flag propagation (PR #125372)

2025-02-02 Thread Matheus Izvekov via cfe-commits
@@ -1841,15 +1841,21 @@ class ClassTemplateSpecializationDecl : public CXXRecordDecl, LLVM_PREFERRED_TYPE(TemplateSpecializationKind) unsigned SpecializationKind : 3; + /// When matching the primary template, have we matched any packs on the + /// parameter side, versus

[clang] [clang] fix P3310 overload resolution flag propagation (PR #125372)

2025-02-02 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/125372 >From 36cab9c0ae9bd24b86dcfa0c260f1b0701d7468e Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Fri, 31 Jan 2025 20:41:39 -0300 Subject: [PATCH] [clang] fix P3310 overload resolution flag propagation Class

[clang] [C++20][Modules][Serialization] Delay marking pending incomplete decl chains until the end of `finishPendingActions`. (PR #121245)

2025-01-29 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM, Thanks! https://github.com/llvm/llvm-project/pull/121245 ___ 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-02 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/125453 This patch makes it so the correct instantiation context is printed for diagnostics suppessed by template argument deduction. The context is saved along with the suppressed diagnostic, and when the declaratio

[clang] Reland: [clang] Track function template instantiation from definition (PR #125266)

2025-02-02 Thread Matheus Izvekov via cfe-commits
@@ -2298,6 +2298,13 @@ class FunctionDecl : public DeclaratorDecl, FunctionDeclBits.IsLateTemplateParsed = ILT; } + bool isInstantiatedFromMemberTemplate() const { +return FunctionDeclBits.IsInstantiatedFromMemberTemplate; + } + void setInstantiatedFromMemberTempl

[clang] Reland: [clang] Track function template instantiation from definition (PR #125266)

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

[clang] Reland: [clang] Track function template instantiation from definition (PR #125266)

2025-02-02 Thread Matheus Izvekov via cfe-commits
@@ -2298,6 +2298,13 @@ class FunctionDecl : public DeclaratorDecl, FunctionDeclBits.IsLateTemplateParsed = ILT; } + bool isInstantiatedFromMemberTemplate() const { +return FunctionDeclBits.IsInstantiatedFromMemberTemplate; + } + void setInstantiatedFromMemberTempl

[clang] Reland: [clang] Track function template instantiation from definition (PR #125266)

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

[clang] Reland: [clang] Track function template instantiation from definition (PR #125266)

2025-02-02 Thread Matheus Izvekov via cfe-commits
@@ -2298,6 +2298,13 @@ class FunctionDecl : public DeclaratorDecl, FunctionDeclBits.IsLateTemplateParsed = ILT; } + bool isInstantiatedFromMemberTemplate() const { +return FunctionDeclBits.IsInstantiatedFromMemberTemplate; + } + void setInstantiatedFromMemberTempl

[clang] Reland: [clang] Track function template instantiation from definition (PR #125266)

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

[clang] Reland: [clang] Track function template instantiation from definition (PR #125266)

2025-02-01 Thread Matheus Izvekov via cfe-commits
@@ -2298,6 +2298,13 @@ class FunctionDecl : public DeclaratorDecl, FunctionDeclBits.IsLateTemplateParsed = ILT; } + bool isInstantiatedFromMemberTemplate() const { +return FunctionDeclBits.IsInstantiatedFromMemberTemplate; + } + void setInstantiatedFromMemberTempl

[clang] [clang] fix P3310 overload resolution flag propagation (PR #125372)

2025-02-01 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/125372 Class templates might be only instantiated when they are required to be complete, but checking the template args against the primary template is immediate. This result is cached so that later when the class i

[clang] [clang] fix P3310 overload resolution flag propagation (PR #125372)

2025-02-01 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/125372 >From 9645f14d3b9aa016cb45ca27ad0425adbbc0e1c6 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Fri, 31 Jan 2025 20:41:39 -0300 Subject: [PATCH] [clang] fix P3310 overload resolution flag propagation Class

[clang] Reland: [clang] Track function template instantiation from definition (PR #125266)

2025-01-31 Thread Matheus Izvekov via cfe-commits
@@ -5276,9 +5277,31 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation, RebuildTypeSourceInfoForDefaultSpecialMembers(); SetDeclDefaulted(Function, PatternDecl->getLocation()); } else { +NamedDecl *ND = Function; +DeclContext *DC

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

2024-12-10 Thread Matheus Izvekov via cfe-commits
@@ -8494,10 +8495,21 @@ DeclResult Sema::ActOnClassTemplateSpecialization( return Specialization; } -Decl *Sema::ActOnTemplateDeclarator(Scope *S, - MultiTemplateParamsArg TemplateParameterLists, -Declarator &D

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

2024-12-10 Thread Matheus Izvekov via cfe-commits
@@ -7946,6 +7980,8 @@ class Sema final : public SemaBase { /// A stack of expression evaluation contexts. SmallVector ExprEvalContexts; + SmallVector PendingLazyContextDecls; mizvekov wrote: The intention is that they are used for any declarations where

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

2024-12-10 Thread Matheus Izvekov via cfe-commits
@@ -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); +

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

2024-12-10 Thread Matheus Izvekov via cfe-commits
@@ -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); +

[clang] Reland [Clang] skip default argument instantiation for non-defining friend declarations to meet [dcl.fct.default] p4 (PR #115487)

2024-12-16 Thread Matheus Izvekov via cfe-commits
@@ -4692,6 +4692,17 @@ bool Sema::InstantiateDefaultArgument(SourceLocation CallLoc, FunctionDecl *FD, ParmVarDecl *Param) { assert(Param->hasUninstantiatedDefaultArg()); + // FIXME: We don't track member specialization info for non-de

[clang] [libcxx] [C++20] [Modules] Convert '-fexperimental-modules-reduced-bmi' to '-fmodules-reduced-bmi' (PR #114382)

2024-12-06 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I still find the current approach wrt the warning to be odd, we would basically force every modules user to change their command line, either by adding the new `-fmodules-reduced-bmi`, or add `-Wno-wathever` to suppress the warning, or just learn to live with the warning I gue

[clang] [clang-tools-extra] [clang] [Sema] Preserve nested name specifier prefix in MemberPointerType (PR #118236)

2024-12-06 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. Thanks, LGTM! https://github.com/llvm/llvm-project/pull/118236 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] [Sema] Preserve nested name specifier prefix in MemberPointerType (PR #118236)

2024-12-06 Thread Matheus Izvekov via cfe-commits
@@ -5347,13 +5347,16 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, case NestedNameSpecifier::TypeSpec: case NestedNameSpecifier::TypeSpecWithTemplate: - ClsType = QualType(NNS->getAsType(), 0); + const Type *N

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

2025-01-24 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited 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] disallow narrowing when matching template template parameters (PR #124313)

2025-01-24 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited 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] disallow narrowing when matching template template parameters (PR #124313)

2025-01-24 Thread Matheus Izvekov via cfe-commits
@@ -6930,17 +6934,20 @@ ExprResult Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param, IsConvertedConstantExpression = false; } - if (getLangOpts().CPlusPlus17) { + if (getLangOpts().CPlusPlus17 || PartialOrderingTTP) { // C++17 [temp.arg.nontype]p1:

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

2025-01-24 Thread Matheus Izvekov via cfe-commits
@@ -11682,6 +11683,7 @@ class Sema final : public SemaBase { SmallVectorImpl &SugaredConverted, SmallVectorImpl &CanonicalConverted, CheckTemplateArgumentKind CTAK, bool PartialOrdering, +

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

2025-01-24 Thread Matheus Izvekov via cfe-commits
@@ -6930,17 +6934,20 @@ ExprResult Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param, IsConvertedConstantExpression = false; } - if (getLangOpts().CPlusPlus17) { + if (getLangOpts().CPlusPlus17 || PartialOrderingTTP) { // C++17 [temp.arg.nontype]p1:

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

2025-01-24 Thread Matheus Izvekov via cfe-commits
@@ -6930,17 +6934,20 @@ ExprResult Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param, IsConvertedConstantExpression = false; } - if (getLangOpts().CPlusPlus17) { + if (getLangOpts().CPlusPlus17 || PartialOrderingTTP) { // C++17 [temp.arg.nontype]p1:

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

2025-01-24 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/124313 >From 7a7950dd8fd6a01cdc0d1351b86962798d300ea6 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sun, 12 Jan 2025 14:45:24 -0300 Subject: [PATCH] [clang] disallow narrowing when matching template template p

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

2025-01-24 Thread Matheus Izvekov via cfe-commits
@@ -6930,17 +6934,20 @@ ExprResult Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param, IsConvertedConstantExpression = false; } - if (getLangOpts().CPlusPlus17) { + if (getLangOpts().CPlusPlus17 || PartialOrderingTTP) { // C++17 [temp.arg.nontype]p1:

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

2025-01-24 Thread Matheus Izvekov via cfe-commits
@@ -6930,17 +6934,20 @@ ExprResult Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param, IsConvertedConstantExpression = false; } - if (getLangOpts().CPlusPlus17) { + if (getLangOpts().CPlusPlus17 || PartialOrderingTTP) { // C++17 [temp.arg.nontype]p1:

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

2025-01-24 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/124313 This fixes the core issue described in P3579, following the design intent of P0522 to not introduce any new cases where a template template parameter match is allowed for a template which is not valid for all

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

2025-01-24 Thread Matheus Izvekov via cfe-commits
@@ -11682,6 +11683,7 @@ class Sema final : public SemaBase { SmallVectorImpl &SugaredConverted, SmallVectorImpl &CanonicalConverted, CheckTemplateArgumentKind CTAK, bool PartialOrdering, +

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

2025-01-24 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/124313 >From 1d9605013487b8361ff471ef494b4be94bd37470 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sun, 12 Jan 2025 14:45:24 -0300 Subject: [PATCH] [clang] disallow narrowing when matching template template p

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

2025-01-23 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Can you explain the revert-issue, and what you did to fix it? The github diff > is making REALLY difficult to understand what you did.. If you go on the commit list, you can click on the commit which I pointed out in the OP ([clang] Changes to template argument list checking"

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

2025-01-23 Thread Matheus Izvekov via cfe-commits
@@ -5570,61 +5570,73 @@ bool Sema::CheckTemplateArgumentList( } if (ArgIdx < NumArgs) { - // Check the template argument we were given. - if (CheckTemplateArgument(*Param, NewArgs[ArgIdx], Template, TemplateLoc, -RAngleLoc, Sug

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

2025-01-23 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed 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] Correctly propagate type aliases' unexpanded flags up to lambda (PR #122875)

2025-01-17 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. I think the change is ok, but I don't think this fixes the underlying issue. There is something generally wrong with type aliases which don't use all of their parameters, and this needs more thought. https://github.com/llvm/llvm-project/p

[clang] [Clang] Remove unnecessary Decl transform & profiles for SizeOfPackExpr (PR #124533)

2025-01-27 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM, Thanks! 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

[clang] 7107f55 - [clang] NFC: remove redundant dyn_cast

2025-01-26 Thread Matheus Izvekov via cfe-commits
Author: Matheus Izvekov Date: 2025-01-27T00:26:38-03:00 New Revision: 7107f55d82f8d1077d5478e8f58c94851385c06f URL: https://github.com/llvm/llvm-project/commit/7107f55d82f8d1077d5478e8f58c94851385c06f DIFF: https://github.com/llvm/llvm-project/commit/7107f55d82f8d1077d5478e8f58c94851385c06f.dif

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

2025-01-25 Thread Matheus Izvekov via cfe-commits
@@ -66,8 +66,9 @@ namespace DependentType { using ok = Pt, tT0>; using err1 = tT0; // expected-error {{too few template arguments for class template 'ii'}} // expected-note@-1 {{different template parameters}} - using err2 = tT0; // FIXME: sh

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

2025-01-25 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/124313 >From f2df46da93aeeaed9f774322231866a7509e3fa0 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sun, 12 Jan 2025 14:45:24 -0300 Subject: [PATCH] [clang] disallow narrowing when matching template template p

[clang] [clang] improve print / dump of anonymous declarations (PR #124605)

2025-01-27 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/124605 ast-print: A DeclRef to an anonymous NTTP will print 'value-parameter--', similar to how type parameters are printed. ast-dump: A bareDeclRef to an anonymous entity will print some extra identifying informati

[clang] [clang] improve print / dump of anonymous declarations (PR #124605)

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

<    6   7   8   9   10   11   12   13   14   15   >