[clang] [clang-tools-extra] [clang] Implement CWG2398 provisional TTP matching to class templates (PR #94981)

2024-06-13 Thread Matheus Izvekov via cfe-commits
@@ -9219,7 +9222,8 @@ class Sema final : public SemaBase { /// \returns true if an error occurred, false otherwise. bool CheckTemplateArgumentList( TemplateDecl *Template, SourceLocation TemplateLoc, - TemplateArgumentListInfo , bool PartialTemplateArgs, +

[clang] e090bac - [clang] NFC: add new cwg2398 tests

2024-06-09 Thread Matheus Izvekov via cfe-commits
Author: Matheus Izvekov Date: 2024-06-09T13:44:45-03:00 New Revision: e090bac638e56ff9db87e622cdf925f2b99dfc30 URL: https://github.com/llvm/llvm-project/commit/e090bac638e56ff9db87e622cdf925f2b99dfc30 DIFF:

[clang] [clang] improve TemplateArgument and TemplateName dump methods (PR #94905)

2024-06-09 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/94905 These will work as AST Text node dumpers, as usual, instead of AST printers. Note that for now, the TemplateName dumper is using the TemplateArgument dumper through an implicit conversion. This can be fixed in

[clang] [clang] NFCI: improve TemplateArgument and TemplateName dump methods (PR #94905)

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

[clang] [clang] NFCI: improve TemplateArgument and TemplateName dump methods (PR #94905)

2024-06-10 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/94905 >From f918649a9208c2250873eb63641e106478371b43 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sat, 8 Jun 2024 11:07:27 -0300 Subject: [PATCH] [clang] improve TemplateArgument and TemplateName dump

[clang] [clang] NFCI: improve TemplateArgument and TemplateName dump methods (PR #94905)

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

[clang] [clang] NFCI: improve TemplateArgument and TemplateName dump methods (PR #94905)

2024-06-10 Thread Matheus Izvekov via cfe-commits
@@ -360,3 +360,34 @@ LLVM_DUMP_METHOD void ConceptReference::dump(raw_ostream ) const { ASTDumper P(OS, Ctx, Ctx.getDiagnostics().getShowColors()); P.Visit(this); } + +//===--===// +// TemplateName method

[clang] [clang-tools-extra] [clang] Implement CWG2398 provisional TTP matching to class templates (PR #94981)

2024-06-10 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/94981 This extends default argument deduction to cover class templates as well, and also applies outside of partial ordering, adding to the provisional wording introduced in

[clang] [clang-tools-extra] [clang] Implement CWG2398 provisional TTP matching to class templates (PR #94981)

2024-06-10 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/94981 >From 015a05707caad5d39909bc68a5371161de464d9d Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 20 May 2024 01:15:03 -0300 Subject: [PATCH] [clang] Implement CWG2398 provisional TTP matching to class

[clang] [clang-tools-extra] [clang] Implement CWG2398 provisional TTP matching to class templates (PR #94981)

2024-06-10 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/94981 >From ea98dec85a9817eb4e35ce97389433e4a5b9676d Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 20 May 2024 01:15:03 -0300 Subject: [PATCH] [clang] Implement CWG2398 provisional TTP matching to class

[clang] [Clang] Instantiate local constexpr functions eagerly (PR #95660)

2024-06-15 Thread Matheus Izvekov via cfe-commits
@@ -18112,7 +18112,8 @@ void Sema::MarkFunctionReferenced(SourceLocation Loc, FunctionDecl *Func, if (FirstInstantiation || TSK != TSK_ImplicitInstantiation || Func->isConstexpr()) { - if (isa(Func->getDeclContext()) && + if

[clang] [Clang] Instantiate local constexpr functions eagerly (PR #95660)

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

[clang] [Clang] Instantiate local constexpr functions eagerly (PR #95660)

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

[clang] [clang] fix broken canonicalization of DeducedTemplateSpecializationType (PR #95202)

2024-06-12 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/95202 >From dadb9244bee22bc303af154b47f527b973940b40 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Wed, 12 Jun 2024 00:42:48 -0300 Subject: [PATCH] [clang] fix broken canonicalization of

[clang] [clang] fix broken canonicalization of DeducedTemplateSpecializationType (PR #95202)

2024-06-12 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I don't think regression tests are the right level here, we risk creating an unstable test. I have added a new unittest module for Profiling tests. I hope some day we will have time to add one test case for each property of each AST node. Though I still think the first line

[clang] [clang] fix broken canonicalization of DeducedTemplateSpecializationType (PR #95202)

2024-06-12 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/95202 >From 5c4fa3ce2ce23fdaf877b71b2775244d15a149d3 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Wed, 12 Jun 2024 00:42:48 -0300 Subject: [PATCH] [clang] fix broken canonicalization of

[clang] [clang] fix broken canonicalization of DeducedTemplateSpecializationType (PR #95202)

2024-06-12 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/95202 This reverts the functional elements of commit 3e78fa860235431323aaf08c8fa922d75a7cfffa and redoes it, by fixing the true root cause of #61317. A TemplateName can be non-canonical; profiling it based on the

[clang] [clang] fix broken canonicalization of DeducedTemplateSpecializationType (PR #95202)

2024-06-12 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: It still fixes the original bug report though. Otherwise adding a test which directly tests all observable effects of the profiling fix would be a bit arbitrary, as we don't have any unit tests for the gazillion ways this could go wrong for the other AST nodes. This usually

[clang] [clang] fix broken canonicalization of DeducedTemplateSpecializationType (PR #95202)

2024-06-12 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Or, are you saying it is too hard to get reduced? > > I don't have a reduced test case. It's not impossible to reduce. Though we usually do a poor job of preserving TemplateNames in other places, which makes this harder to test. I have patches on my pipeline dealing with

[clang] [clang-tools-extra] [clang] Implement CWG2398 provisional TTP matching to class templates (PR #94981)

2024-06-12 Thread Matheus Izvekov via cfe-commits
@@ -6371,6 +6376,70 @@ ASTContext::getCanonicalTemplateName(const TemplateName ) const { canonArgPack, subst->getAssociatedDecl()->getCanonicalDecl(), subst->getFinal(), subst->getIndex()); } + case TemplateName::DeducedTemplate: { +assert(IgnoreDeduced

[clang] [clang-tools-extra] [clang] Implement CWG2398 provisional TTP matching to class templates (PR #94981)

2024-06-12 Thread Matheus Izvekov via cfe-commits
@@ -6371,6 +6376,70 @@ ASTContext::getCanonicalTemplateName(const TemplateName ) const { canonArgPack, subst->getAssociatedDecl()->getCanonicalDecl(), subst->getFinal(), subst->getIndex()); } + case TemplateName::DeducedTemplate: { +assert(IgnoreDeduced

[clang] [clang-tools-extra] [clang] Implement CWG2398 provisional TTP matching to class templates (PR #94981)

2024-06-12 Thread Matheus Izvekov via cfe-commits
@@ -9434,6 +9505,32 @@ ASTContext::getSubstTemplateTemplateParmPack(const TemplateArgument , return TemplateName(Subst); } +/// Retrieve the template name that represents a template name +/// deduced from a specialization. +TemplateName

[clang] [clang-tools-extra] [clang] Implement CWG2398 provisional TTP matching to class templates (PR #94981)

2024-06-12 Thread Matheus Izvekov via cfe-commits
@@ -9219,7 +9222,8 @@ class Sema final : public SemaBase { /// \returns true if an error occurred, false otherwise. bool CheckTemplateArgumentList( TemplateDecl *Template, SourceLocation TemplateLoc, - TemplateArgumentListInfo , bool PartialTemplateArgs, +

[clang] [clang-tools-extra] [clang] Implement CWG2398 provisional TTP matching to class templates (PR #94981)

2024-06-12 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: FYI https://github.com/itanium-cxx-abi/cxx-abi/issues/184 is the tracking issue for the mangling rules we need here. We will probably end up with something quite different than what I coded here so far. https://github.com/llvm/llvm-project/pull/94981

[clang] [clang] Don't print extra space when dumping template names (PR #95213)

2024-06-12 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. I think what I tried to do here is generally consistent: The convention on the Text node dumper is to add a space at the beginning of the field you want to append. I think the true issue here is the label: It breaks convention by adding

[clang] [Clang][Sema] qualifier should be transformed (PR #94725)

2024-06-12 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I think this is missing one detail: We now have the same qualifier in two places: The elaborated type node attached to the TST, and in the name of the TST itself. While this is not ideal situation, I think it makes sense to just drop the TemplateName qualifier in the

[clang] [clang] fix broken canonicalization of DeducedTemplateSpecializationType (PR #95202)

2024-06-12 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/95202 >From 8bd63f109c2bc1888b4d8dbd5e880900bbb4cef7 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Wed, 12 Jun 2024 00:42:48 -0300 Subject: [PATCH] [clang] fix broken canonicalization of

[clang] [clang-tools-extra] [clang] Implement CWG2398 provisional TTP matching to class templates (PR #94981)

2024-06-12 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/94981 >From f05e8590c7fae599d0658829949fa907942e83f2 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 20 May 2024 01:15:03 -0300 Subject: [PATCH] [clang] Implement CWG2398 provisional TTP matching to class

[clang] [Clang][Sema] qualifier should be transformed (PR #94725)

2024-06-12 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov requested changes to this pull request. Needs changes as discussed. https://github.com/llvm/llvm-project/pull/94725 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-tools-extra] [clang] Implement CWG2398 provisional TTP matching to class templates (PR #94981)

2024-06-12 Thread Matheus Izvekov via cfe-commits
@@ -9434,6 +9505,32 @@ ASTContext::getSubstTemplateTemplateParmPack(const TemplateArgument , return TemplateName(Subst); } +/// Retrieve the template name that represents a template name +/// deduced from a specialization. +TemplateName

[clang] [clang] fix broken canonicalization of DeducedTemplateSpecializationType (PR #95202)

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

[clang] Check whether EvaluatedStmt::Value is valid in VarDecl::hasInit (PR #94515)

2024-06-12 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. This is much better, thanks! LGTM https://github.com/llvm/llvm-project/pull/94515 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] Check whether EvaluatedStmt::Value is valid in VarDecl::hasInit (PR #94515)

2024-06-12 Thread Matheus Izvekov via cfe-commits
@@ -2402,10 +2405,9 @@ Expr *VarDecl::getInit() { auto *Eval = getEvaluatedStmt(); - return cast_if_present( - Eval->Value.isOffset() - ? Eval->Value.get(getASTContext().getExternalSource()) - : Eval->Value.get(nullptr)); + return

[clang] Check whether EvaluatedStmt::Value is valid in VarDecl::hasInit (PR #94515)

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

[clang] [llvm] Enable LLDB tests in Linux pre-merge CI (PR #94208)

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

[clang] [clang-tools-extra] [clang] Implement CWG2398 provisional TTP matching to class templates (PR #94981)

2024-06-10 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/94981 >From 68791782b7a1a0eafa98950f6e03aa1585be5223 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 20 May 2024 01:15:03 -0300 Subject: [PATCH] [clang] Implement CWG2398 provisional TTP matching to class

[clang] [clang-tools-extra] [clang] Implement CWG2398 provisional TTP matching to class templates (PR #94981)

2024-06-18 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/94981 >From b238961ba3a174d7dc211caf36ff8fd6c8429a76 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 20 May 2024 01:15:03 -0300 Subject: [PATCH] [clang] Implement CWG2398 provisional TTP matching to class

[clang] [Clang][Sema] Treat explicit specializations of static data member templates declared without 'static' as static data members when diagnosing uses of 'auto' (PR #97425)

2024-07-02 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. https://github.com/llvm/llvm-project/pull/97425 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] CTAD alias: fix transformation for require-clause expr Part2. (PR #93533)

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

[clang] [Clang][Sema] Correctly transform dependent operands of overloaded binary operator& (PR #97596)

2024-07-03 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. https://github.com/llvm/llvm-project/pull/97596 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix crash when rebuilding MemberExprs with invalid object expressions (PR #97455)

2024-07-03 Thread Matheus Izvekov via cfe-commits
@@ -2896,6 +2896,9 @@ class TreeTransform { SS.Adopt(QualifierLoc); Base = BaseResult.get(); +if (Base->containsErrors()) + return ExprError(); mizvekov wrote: I am still traveling back from St Louis, so I can't double check this: Why is

[clang] [Clang][Sema] Fix crash when rebuilding MemberExprs with invalid object expressions (PR #97455)

2024-07-03 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. https://github.com/llvm/llvm-project/pull/97455 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Diagnose use of deprecated template alias (PR #97619)

2024-07-03 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: For reference, see https://reviews.llvm.org/D136533 for similar expansion of diagnostics for uses of declarations, and how that lead to trouble in MacOS land. I'd suggest building libc++ on MacOS, to be sure this won't cause regressions and a future revert. I have a MacOS

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-07-09 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: FYI, the commit 99873b35da7ecb905143c8a6b8deca4d4416f1a9, which lists this PR as a motivator, causes breakage building a project, which I am still looking for a reduced test case. The commit is not NFC despite what is says, just by cursory inspection of the change. Please

[clang] [Clang][Sema] Handle class member access expressions with valid nested-name-specifiers that become invalid after lookup (PR #98167)

2024-07-09 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. https://github.com/llvm/llvm-project/pull/98167 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-07-10 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: The reproducer turned out to be pretty simple: ```C++ export module a; module :private; static void f() {} void g() { f(); } ``` Compiles without that patch, otherwise produces: ``` error: no matching function for call to 'f' ``` > Oh, sorry, I took another look at the

[clang] [clang] CTAD: use index and depth to retrieve template parameter for TemplateParamsReferencedInTemplateArgumentList (PR #98013)

2024-07-11 Thread Matheus Izvekov via cfe-commits
@@ -99,3 +99,28 @@ BFoo b2(1.0, 2.0); // CHECK-NEXT: | | |-ParmVarDecl {{.*}} 'type-parameter-0-0' // CHECK-NEXT: | | `-ParmVarDecl {{.*}} 'type-parameter-0-0' // CHECK-NEXT: | `-CXXDeductionGuideDecl {{.*}} implicit used 'auto (double, double) -> Foo' implicit_instantiation

[clang] [clang] CTAD: use index and depth to retrieve template parameter for TemplateParamsReferencedInTemplateArgumentList (PR #98013)

2024-07-11 Thread Matheus Izvekov via cfe-commits
@@ -2653,20 +2653,34 @@ struct ConvertConstructorToDeductionGuideTransform { // Find all template parameters that appear in the given DeducedArgs. // Return the indices of the template parameters in the TemplateParams. SmallVector

[clang] [clang] CTAD: use index and depth to retrieve template parameter for TemplateParamsReferencedInTemplateArgumentList (PR #98013)

2024-07-11 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM, sans: * missing newline at end of test file * A similar test for template template parameter. https://github.com/llvm/llvm-project/pull/98013 ___ cfe-commits mailing list

[clang] [clang-tools-extra] [Clang][AST] Move NamespaceDecl bits to DeclContext (PR #98567)

2024-07-12 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM, as a clean up, and I see no notable performance implications. Is there any follow up work for this? https://github.com/llvm/llvm-project/pull/98567 ___ cfe-commits mailing list

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-07-12 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Clarifying a couple of things here I think we need the distinction between simple NFC, for trivial, non-controversial and non-surprising changes like some renames, small whitespace / formatting change, documentation changes, and complex NFC, which requires some thinking and

[clang] [clang] Fix crash in concept deprecation (PR #98622)

2024-07-12 Thread Matheus Izvekov via cfe-commits
@@ -7416,10 +7416,11 @@ NamedDecl *Sema::ActOnVariableDeclarator( tryToFixVariablyModifiedVarType(TInfo, R, D.getIdentifierLoc(), /*DiagID=*/0); - if (const AutoType *AutoT = R->getAs()) -CheckConstrainedAuto( -AutoT, -

[clang] [clang] Prevent dangling StringRefs (PR #98699)

2024-07-12 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM. If it does fix the mentioned issue, please add a release note. https://github.com/llvm/llvm-project/pull/98699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Fix crash in concept deprecation (PR #98622)

2024-07-12 Thread Matheus Izvekov via cfe-commits
@@ -7416,10 +7416,11 @@ NamedDecl *Sema::ActOnVariableDeclarator( tryToFixVariablyModifiedVarType(TInfo, R, D.getIdentifierLoc(), /*DiagID=*/0); - if (const AutoType *AutoT = R->getAs()) -CheckConstrainedAuto( -AutoT, -

[clang] [Clang][NFCI] Remove records of unsatisfied atomic expressions in ConstraintSatisfaction (PR #98654)

2024-07-12 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM, I agree that we currently don't use it, so we might as well remove it. But the overall situation is all wrong, we shouldn't be storing fully formed diagnostic strings in the AST, we should be storing them as PartialDiagnostics. But

[clang] [clang] Fix crash in concept deprecation (PR #98622)

2024-07-12 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov requested changes to this pull request. See previous comments, I think this is primarily an error recovery issue on the decltype, we shouldn't let it escape an undeduced auto, as that would confuse further analysis. https://github.com/llvm/llvm-project/pull/98622

[clang] [clang] CTAD: use index and depth to retrieve template parameter for TemplateParamsReferencedInTemplateArgumentList (PR #98013)

2024-07-08 Thread Matheus Izvekov via cfe-commits
@@ -99,3 +99,28 @@ BFoo b2(1.0, 2.0); // CHECK-NEXT: | | |-ParmVarDecl {{.*}} 'type-parameter-0-0' // CHECK-NEXT: | | `-ParmVarDecl {{.*}} 'type-parameter-0-0' // CHECK-NEXT: | `-CXXDeductionGuideDecl {{.*}} implicit used 'auto (double, double) -> Foo' implicit_instantiation

[clang] [clang] CTAD: use index and depth to retrieve template parameter for TemplateParamsReferencedInTemplateArgumentList (PR #98013)

2024-07-08 Thread Matheus Izvekov via cfe-commits
@@ -2653,20 +2653,34 @@ struct ConvertConstructorToDeductionGuideTransform { // Find all template parameters that appear in the given DeducedArgs. // Return the indices of the template parameters in the TemplateParams. SmallVector

[clang] [clang] CTAD: use index and depth to retrieve template parameter for TemplateParamsReferencedInTemplateArgumentList (PR #98013)

2024-07-08 Thread Matheus Izvekov via cfe-commits
@@ -2653,20 +2653,34 @@ struct ConvertConstructorToDeductionGuideTransform { // Find all template parameters that appear in the given DeducedArgs. // Return the indices of the template parameters in the TemplateParams. SmallVector

[clang] [clang] CTAD: use index and depth to retrieve template parameter for TemplateParamsReferencedInTemplateArgumentList (PR #98013)

2024-07-08 Thread Matheus Izvekov via cfe-commits
@@ -2653,20 +2653,34 @@ struct ConvertConstructorToDeductionGuideTransform { // Find all template parameters that appear in the given DeducedArgs. // Return the indices of the template parameters in the TemplateParams. SmallVector

[clang] [Clang][Index] Add support for dependent class scope explicit specializations of function templates to USRGenerator (PR #98027)

2024-07-08 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. https://github.com/llvm/llvm-project/pull/98027 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix the order of addInstantiatedParameters in LambdaScopeForCallOperatorInstantiationRAII (PR #97215)

2024-07-08 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/97215 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Fix crash in Sema::FindInstantiatedDecl (PR #96509)

2024-07-08 Thread Matheus Izvekov via cfe-commits
Alejandro =?utf-8?q?Álvarez_Ayllón?Message-ID: In-Reply-To: @@ -6300,7 +6300,7 @@ NamedDecl *Sema::FindInstantiatedDecl(SourceLocation Loc, NamedDecl *D, getTrivialTemplateArgumentLoc(UnpackedArg, QualType(), Loc)); } QualType T =

[clang] [clang] Change style of superseded issues on C++ DR status page (PR #96051)

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

[clang] [clang-tools-extra] [clang] Implement CWG2398 provisional TTP matching to class templates (PR #94981)

2024-06-19 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: After we fork for clang-20, we can entirely remove `frelaxed-template-template-args`, and so won't need to worry about testing that non-conforming mode. Would it be reasonable to postpone that until then?

[clang] [Clang][Sema] qualifier should be transformed (PR #94725)

2024-06-22 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > @mizvekov After looking into the code, I think we should transform qualifier > in TST. Consider the following code: So the NNS is already dependent, that's great. I still don't understand why you are saying we didn't or can't build a DependentTemplateSpecializationType

[clang] [Clang][Sema] qualifier should be transformed (PR #94725)

2024-06-22 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > I mean we can transform `QualifiedTemplateName` to `DependentTemplateName` > and this is what this patch does. But that goes against the natural flow of template instantiation. We can't go back from non-dependent into dependent. We can't transform a regular TemplateName back

[clang] [Clang][Parse] Fix ambiguity with nested-name-specifiers that may declarative (PR #96364)

2024-07-11 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. https://github.com/llvm/llvm-project/pull/96364 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement P2582R1: CTAD from inherited constructors (PR #98788)

2024-07-19 Thread Matheus Izvekov via cfe-commits
@@ -1254,8 +1341,221 @@ void DeclareImplicitDeductionGuidesForTypeAlias( ->getDeductionCandidateKind() == DeductionCandidate::Aggregate) continue; -BuildDeductionGuideForTypeAlias(SemaRef, AliasTemplate, F, Loc); +

[clang] Avoid accessing unset optional, workaround for #100095 (PR #100408)

2024-07-24 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I don't believe we currently have any code coverage at all for the line affected. So with this change, which we don't fully understand, we could be breaking currently working code, and we could not even be fixing the known broken cases, as there could be further UB down the

[clang] Fix assertion failure during conversion function overload resolution. (PR #98671)

2024-07-24 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > That said... an example like the following sidesteps all these issues and > still crashes clang, so I think the above comments are somewhat orthogonal to > this patch (except that I think we should have something like this as a test > case instead of the current test case):

[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-27 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/100692 >From 89e016886fd87ab54856ed61a0a419d25f7df9e5 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Wed, 24 Jul 2024 03:59:41 -0300 Subject: [PATCH] [clang] check deduction consistency when partial ordering

[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-27 Thread Matheus Izvekov via cfe-commits
@@ -5399,11 +5434,85 @@ static QualType GetImplicitObjectParameterType(ASTContext , return Context.getLValueReferenceType(RawType); } +static TemplateDeductionResult FinishTemplateArgumentDeduction( +Sema , FunctionTemplateDecl *FTD, int ArgIdx, QualType P, QualType A,

[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-27 Thread Matheus Izvekov via cfe-commits
@@ -5346,7 +5346,6 @@ static EvalStmtResult EvaluateStmt(StmtResult , EvalInfo , const Expr *RetExpr = cast(S)->getRetValue(); FullExpressionRAII Scope(Info); if (RetExpr && RetExpr->isValueDependent()) { - EvaluateDependentExpr(RetExpr, Info);

[clang] [libcxx] Reapply "[Clang] Implement resolution for CWG1835 (#92957, #98547)" (PR #100425)

2024-07-27 Thread Matheus Izvekov via cfe-commits
@@ -767,6 +757,7 @@ bool Sema::BuildCXXNestedNameSpecifier(Scope *S, NestedNameSpecInfo , else Diag(IdInfo.IdentifierLoc, diag::err_undeclared_var_use) << IdInfo.Identifier; +#endif mizvekov wrote: You should probably remove these before

[clang] [libcxx] Reapply "[Clang] Implement resolution for CWG1835 (#92957, #98547)" (PR #100425)

2024-07-27 Thread Matheus Izvekov via cfe-commits
@@ -698,13 +685,15 @@ bool Sema::BuildCXXNestedNameSpecifier(Scope *S, NestedNameSpecInfo , if (ErrorRecoveryLookup) return true; +#if 0 // If we didn't find anything during our lookup, try again with // ordinary name lookup, which can help us produce better

[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-27 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @MaskRay the latest version fixes libc++ regressions. Also abseil-cpp builds correctly on MacOS, according to those instructions. https://github.com/llvm/llvm-project/pull/100692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)

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

[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-28 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/100692 >From 89e5db41f3d3bc939078b63d43b7181bfc765fd1 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Wed, 24 Jul 2024 03:59:41 -0300 Subject: [PATCH] [clang] check deduction consistency when partial ordering

[clang] [libcxx] [llvm] Reapply "[Clang] Implement resolution for CWG1835 (#92957)" (PR #98547)

2024-07-19 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Another option would be to apply the resolution to all modes, but recover and issue a warning instead of an error. How feasible would that be? https://github.com/llvm/llvm-project/pull/98547 ___ cfe-commits mailing list

[clang] [clang] Diagnose use of deprecated template alias (PR #97619)

2024-07-19 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM as well. https://github.com/llvm/llvm-project/pull/97619 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [llvm] Reapply "[Clang] Implement resolution for CWG1835 (#92957)" (PR #98547)

2024-07-19 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > WDYAT? We generally try to avoid issuing more than one error diagnostic for the same problem. Couldn't we instead issue a note `note: maybe missing 'template' keyword prior to dependent template name 'A'` attached to the first error instead?

[clang] [libcxx] [llvm] Reapply "[Clang] Implement resolution for CWG1835 (#92957)" (PR #98547)

2024-07-19 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > @mizvekov Without unannotated tentative parsing (to be _properly_ introduced > by #96364), issuing a warning is infeasible. Either way, by the time we > detect the error we could be who knows how deep into the second operand of a > `>` operator. So when we are parsing

[clang] [Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros (PR #90574)

2024-07-21 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I don't think I'll be able to provide a reproducer today. Regardless, bugs in modules are in general not easy to reduce. Unless you think you can fix this soon enough, I think a revert is appropriate here. https://github.com/llvm/llvm-project/pull/90574

[clang] [Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros (PR #90574)

2024-07-21 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I am also seeing breakages which are solved by reverting this change. The failure occurs when importing modules from within header files: ``` error: expected a module name after 'import' 11 | import std; ``` https://github.com/llvm/llvm-project/pull/90574

[clang] [Clang] Implement P3034R1 Module Declarations Shouldn’t be Macros (PR #90574)

2024-07-21 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > It would be nice to have a reproducer. I can't tell the root cause from this > error, so I can't use it to strengthen the current tests. I intend to provide a reproducer. I just can't do it today. So don't wait on it as a justification to avoid reverting.

[clang] [libcxx] [llvm] Reapply "[Clang] Implement resolution for CWG1835 (#92957)" (PR #98547)

2024-07-19 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > We already do that :) the problem is when what follows `A` _doesn't_ > unambiguously look like a template argument list: Sure, but before CWG1835, we would perform the lookup anyway and treat the `<0>` as a template argument list, even if it isn't unambiguously a template

[clang] [libcxx] [llvm] Reapply "[Clang] Implement resolution for CWG1835 (#92957)" (PR #98547)

2024-07-22 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > I'm not sure I follow. If we "treat the `<0>` as a template argument list, > even if it isn't unambiguously a template argument list.", then aren't > applying CWG1835 at all. Yes, in that case. But I am arguing for selectively applying it. I thought that could work, but I

[clang] Template Diagnostic Improvements (PR #99933)

2024-07-22 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: Hi. The change looks good. There are some other examples of bad diagnostics in that issue, and it would be ideal if they are preserved in case this PR closes that issue. Please also add an entry to `clang/docs/ReleaseNotes.rst`.

[clang] [C] Disable use of NRVO (PR #101038)

2024-07-29 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > I doubt anyone is intentionally depending on equality here. > The difference wrt the gnu::cleanup behavior looks plausible: https://github.com/llvm/llvm-project/issues/100868 https://github.com/llvm/llvm-project/pull/101038 ___

[clang] [C] Disable use of NRVO (PR #101038)

2024-07-29 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: >From my testing in compiler explorer, GCC and Clang always produce programs >that return 1 as far back as we can test. ICC and MSVC do otherwise, they return 0. So I think this supports the notion that this should be a dialect, and we have to wire defaults differently in MSVC

[clang] [C] Disable use of NRVO (PR #101038)

2024-07-29 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I agree it's strange choice the effects of elide-constructor are applied on the CodeGen side, by ignoring the AST, instead of on the AST directly. https://github.com/llvm/llvm-project/pull/101038 ___ cfe-commits mailing list

[clang] [C] Disable use of NRVO (PR #101038)

2024-07-29 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: It doesn't seem like elide-constructors is wired to control this behavior. Seems to be wired only to the StaticAnalyzer presently. Regardless, the decision where to apply NRVO is currently centralized in SemaStmt. I think "Sema::getNamedReturnInfo(const VarDecl *VD)" would be

[clang] [libcxx] Reapply "[Clang] Implement resolution for CWG1835 (#92957, #98547)" (PR #100425)

2024-07-30 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Nice! Please keep track and let us know which parts we haven't seen and have important changes we need to pay more attention to during re-review. Otherwise the patch is getting quite big already :) https://github.com/llvm/llvm-project/pull/100425

[clang] [clang] Add deprecation warning for `-Ofast` driver option (PR #98736)

2024-07-16 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. https://github.com/llvm/llvm-project/pull/98736 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix assertion failure during conversion function overload resolution. (PR #98671)

2024-07-16 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM as well https://github.com/llvm/llvm-project/pull/98671 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-07-15 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > That's a pretty substantial policy change to propose, and this probably isn't > the place to propose/discuss it. If that's your intent, probably best to take > that up on discord. > I am not proposing a policy change. I believe the current policy is aimed at giving an

[clang] [clang] Fix crash in concept deprecation (PR #98622)

2024-07-15 Thread Matheus Izvekov via cfe-commits
@@ -7416,10 +7416,11 @@ NamedDecl *Sema::ActOnVariableDeclarator( tryToFixVariablyModifiedVarType(TInfo, R, D.getIdentifierLoc(), /*DiagID=*/0); - if (const AutoType *AutoT = R->getAs()) -CheckConstrainedAuto( -AutoT, -

[clang] [clang] Add deprecation warning for `-Ofast` driver option (PR #98736)

2024-07-15 Thread Matheus Izvekov via cfe-commits
@@ -442,6 +442,9 @@ def warn_drv_deprecated_arg : Warning< def warn_drv_deprecated_arg_no_relaxed_template_template_args : Warning< "argument '-fno-relaxed-template-template-args' is deprecated">, InGroup; +def warn_drv_deprecated_arg_ofast : Warning< + "argument '-Ofast'

[clang] [clang-tools-extra] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-07-26 Thread Matheus Izvekov via cfe-commits
@@ -5425,34 +5534,112 @@ static bool isAtLeastAsSpecializedAs(Sema , SourceLocation Loc, // the partial ordering is done: TemplateDeductionInfo Info(Loc); switch (TPOC) { - case TPOC_Call: + case TPOC_Call: { if (DeduceTemplateArguments(S, TemplateParams,

<    1   2   3   4   5   6   7   >