[clang] [clang] Enable C++17 relaxed template template argument matching by default (PR #89807)

2024-05-13 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: The fix was committed, and we just reverted the revert, so default is back to `-frelaxed-template-template-args`. https://github.com/llvm/llvm-project/pull/89807 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] Revert "[clang] Revert default behavior change of P0522R0 implementation (#91811)" (PR #91837)

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

[clang] Revert "[clang] Revert default behavior change of P0522R0 implementation (#91811)" (PR #91837)

2024-05-13 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov ready_for_review https://github.com/llvm/llvm-project/pull/91837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[clang] Revert default behavior change of P0522R0 implementation (#91811)" (PR #91837)

2024-05-13 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/91837 >From 1a5b4761ba804a0998faf009370d74fa486014d9 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sat, 11 May 2024 00:42:27 -0300 Subject: [PATCH] Revert "[clang] Revert default behavior change of P0522R0

[clang] Revert "[clang] Revert default behavior change of P0522R0 implementation (#91811)" (PR #91837)

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

[clang] [clang] Allow pack expansions when partial ordering against template template parameters (PR #91833)

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

[clang] [clang] Allow pack expansions when partial ordering against template template parameters (PR #91833)

2024-05-13 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/91833 >From 06b9c19a1d194240be3199d50819090b10d697b6 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Fri, 10 May 2024 23:21:22 -0300 Subject: [PATCH] [clang] Allow pack expansions when partial ordering against

[clang] [clang] Allow pack expansions when partial ordering against template template parameters (PR #91833)

2024-05-13 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/91833 >From f882dca5a53a6da8ad92492f28f9eacffb34a780 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Fri, 10 May 2024 23:21:22 -0300 Subject: [PATCH] [clang] Allow pack expansions when partial ordering against

[clang] [clang] Enable C++17 relaxed template template argument matching by default (PR #89807)

2024-05-13 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > @mizvekov Thank you! With that patch, clang not only doesn't crash on stdexec > with `-frelaxed-template-template-args`, but in fact accepts the code. Thanks! The crash is still there and is pre-existing, but it's a 'crash-on-invalid' issue, which is lower priority.

[clang] [clang] Enable C++17 relaxed template template argument matching by default (PR #89807)

2024-05-10 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @sam-mccall @bgra8 @ericniebler I believe this MR should fix your issues: https://github.com/llvm/llvm-project/pull/91833 Can you double check? You might consider applying https://github.com/llvm/llvm-project/pull/91837, since that is stacked on that and will revert the

[clang] [clang] Allow pack expansions when partial ordering against template template parameters (PR #91833)

2024-05-10 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/91833 When partial ordering alias templates against template template parameters, allow pack expansions when the alias has a fixed-size parameter list. These expansions were generally disallowed by proposed

[clang] [Clang] Fix tests broken by #91811 (PR #91822)

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

[clang] [clang] Revert default behavior change of P0522R0 implementation (PR #91811)

2024-05-10 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/91811 This partially reverts b86e0992bfa6c58be077d82d824016f590ac5d90. Just the default is changed back, on the Driver side. No Frontend changes. The positive spelling of the flag is undeprecated. No documentation

[clang] [clang] Enable C++17 relaxed template template argument matching by default (PR #89807)

2024-05-10 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: By the way, creduce/cvise won't help much here unless the interestingness test accounts for 'works on GCC'. Otherwise, It'd be trivial to conjure some snippet of code that works before P0522, but breaks afterward as intended. https://github.com/llvm/llvm-project/pull/89807

[clang] [clang] Enable C++17 relaxed template template argument matching by default (PR #89807)

2024-05-10 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I am repeating myself here, but the crash happens after a bunch of errors: it's not significant, we have evidence this sort of crash is associated with error recovery. This patch implements a standard mandated breaking change, and this 'stdexec' is user code. Without evidence

[clang] [clang] Enable C++17 relaxed template template argument matching by default (PR #89807)

2024-05-09 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > @mizvekov I have a [reduced test > case](https://github.com/llvm/llvm-project/files/15261978/repro.zip) for the > crash @sam-mccall reported. > > Clang does not crash before but crashes at this revision. Thanks. I confirm it crashes, but it crashes on clang 18.1.4 as well,

[clang] [clang] Enable C++17 relaxed template template argument matching by default (PR #89807)

2024-05-08 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Here's a preprocessed file: > [repro.zip](https://github.com/llvm/llvm-project/files/15250584/repro.zip) > > I tried to reduce, and got rid of most of the test code and some of the > stdexec code, but there's still a lot left. I hit the end of my timebox on > that. Maybe

[clang] [clang] Enable C++17 relaxed template template argument matching by default (PR #89807)

2024-05-07 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Thanks, guarding the second specialization with the feature test macro works. > > > > I will try to reduce the test case tomorrow, if you still need this. > > Thanks. If it's not too much work for you, that would be great. Otherwise, I think a pretty good guess can be

[clang] [clang] Enable C++17 relaxed template template argument matching by default (PR #89807)

2024-05-07 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Oh I see the code already includes workaround for GCC vs non-GCC. It's possible in this case you may replace the workaround with a check for the feature testing macro. But if this is a new ambiguity not covered by any of the cases I am tracking, it could still be worthwhile

[clang] [clang] Enable C++17 relaxed template template argument matching by default (PR #89807)

2024-05-07 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Hi, is there a way to make a compile-time check for this feature? Yes, this is exposed by a standard feature testing macro: https://en.cppreference.com/w/cpp/feature_test#cpp_template_template_args > > Looking at > Thanks for reporting this. A few questions: * Does

[clang] [clang] CTAD: fix the aggregate deduction guide for alias templates. (PR #90894)

2024-05-07 Thread Matheus Izvekov via cfe-commits
@@ -261,6 +261,13 @@ AG ag = {1}; // CHECK: | `-BuiltinType {{.*}} 'int' // CHECK: `-ParmVarDecl {{.*}} 'int' +template +using BG = G; +BG bg(1.0); +// CHECK-LABEL: Dumping +// CHECK: FunctionTemplateDecl {{.*}} implicit +// CHECK: |-CXXDeductionGuideDecl {{.*}}

[clang] [clang] CTAD: fix the aggregate deduction guide for alias templates. (PR #90894)

2024-05-07 Thread Matheus Izvekov via cfe-commits
@@ -261,6 +261,13 @@ AG ag = {1}; // CHECK: | `-BuiltinType {{.*}} 'int' // CHECK: `-ParmVarDecl {{.*}} 'int' +template +using BG = G; +BG bg(1.0); +// CHECK-LABEL: Dumping +// CHECK: FunctionTemplateDecl {{.*}} implicit +// CHECK: |-CXXDeductionGuideDecl {{.*}}

[clang] [Clang][Sema] Explicit template arguments are not substituted into the exception specification of a function (PR #90760)

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

[clang] [clang] CTAD: fix the aggregate deduction guide for alias templates. (PR #90894)

2024-05-03 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. This looks like a straightforward fix to me as well LGTM https://github.com/llvm/llvm-project/pull/90894 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] CTAD: fix the aggregate deduction guide for alias templates. (PR #90894)

2024-05-03 Thread Matheus Izvekov via cfe-commits
@@ -261,6 +261,13 @@ AG ag = {1}; // CHECK: | `-BuiltinType {{.*}} 'int' // CHECK: `-ParmVarDecl {{.*}} 'int' +template +using BG = G; +BG bg(1.0); +// CHECK-LABEL: Dumping +// CHECK: FunctionTemplateDecl {{.*}} implicit +// CHECK: |-CXXDeductionGuideDecl {{.*}}

[clang] [clang] CTAD: fix the aggregate deduction guide for alias templates. (PR #90894)

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

[clang] [clang] Implement provisional wording for CWG2398 regarding packs (PR #90820)

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

[clang] [clang] Implement provisional wording for CWG2398 regarding packs (PR #90820)

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

[clang] 62c2959 - [clang] NFC: cxx_status mark P0522R0 as unreleased

2024-05-02 Thread Matheus Izvekov via cfe-commits
Author: Matheus Izvekov Date: 2024-05-02T13:55:33-03:00 New Revision: 62c29593be317f6cfaed8ffbcc016bd2c94c35d4 URL: https://github.com/llvm/llvm-project/commit/62c29593be317f6cfaed8ffbcc016bd2c94c35d4 DIFF:

[clang] [clang] Implement provisional wording for CWG2398 regarding packs (PR #90820)

2024-05-02 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Sounds like should perhaps note that we are implementing our own resolution, > until there's an update to the cwg issue that can be referred to? That could be. Is there another similar issue we could use as a reference on the format for

[clang] [clang] Implement provisional wording for CWG2398 regarding packs (PR #90820)

2024-05-02 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: It would not be splitting though, it would be wholesale duplication in that case. This file is the only part of the suite still testing the old non-conformant mode, and I fail to see a test case we wouldn't be wanting to test on both.

[clang] [clang] Implement provisional wording for CWG2398 regarding packs (PR #90820)

2024-05-02 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Note we are not implementing the solution Jason posted on the core mailing list, neither on the previous patch, as we have a better solution than current GCC on this, nor on this MR, as GCC implements no such workaround and still fails this

[clang] [clang] Implement provisional wording for CWG2398 regarding packs (PR #90820)

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

[clang] [clang] Implement provisional wording for CWG2398 regarding packs (PR #90820)

2024-05-02 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I had some discussion about that with @Endilll on the previous MR regarding this core issue: https://github.com/llvm/llvm-project/pull/89807 Since there is no posting at all in core about any possible solutions, I wanted to get feedback from

[clang] [clang] Implement provisional wording for CWG2398 regarding packs (PR #90820)

2024-05-01 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/90820 This solves some ambuguity introduced in P0522 regarding how template template parameters are partially ordered, and should reduce the negative impact of enabling `-frelaxed-template-template-args` by default.

[clang] [clang] Enable C++17 relaxed template template argument matching by default (PR #89807)

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

[clang] [Clang][Sema] fix a bug on constraint check with template friend function (PR #90646)

2024-05-01 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I agree with @sdkrystian, even though the test crashes for maybe yet another reason, it demonstrates you can friend a function from a different template context, so comparing the depths from different branches is not helpful. https://github.com/llvm/llvm-project/pull/90646

[clang] [clang] Enable C++17 relaxed template template argument matching by default (PR #89807)

2024-04-30 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/89807 >From 1756044e71d756f7102f962d0298627ede27871c Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Tue, 9 Apr 2024 01:14:28 -0300 Subject: [PATCH] [clang] Enable C++17 relaxed template template argument

[clang] Fix a crash introduced by 3d5e9ab by adding a nullptr check. (PR #90301)

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

[clang] [clang] Enable C++17 relaxed template template argument matching by default (PR #89807)

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

[clang] [clang] Enable C++17 relaxed template template argument matching by default (PR #89807)

2024-04-27 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > @mizvekov We have a bunch of related issues, could you look at them > https://github.com/llvm/llvm-project/issues?q=is%3Aissue+is%3Aopen+%22-frelaxed-template-template-args%22 > ? Removed a bunch of duplicates. 4 issues remaining: 1) #36505 Is the issue we are fixing in

[clang] [clang] Enable C++17 relaxed template template argument matching by default (PR #89807)

2024-04-27 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/89807 >From 4ee58efa0f154b531dcc674b6f4fe084182aa803 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Tue, 9 Apr 2024 01:14:28 -0300 Subject: [PATCH] [clang] Enable C++17 relaxed template template argument

[clang] Fix a crash introduced by 3d5e9ab by adding a nullptr check. (PR #90301)

2024-04-27 Thread Matheus Izvekov via cfe-commits
@@ -54,7 +54,7 @@ class UncountedCallArgsChecker bool shouldVisitImplicitCode() const { return false; } bool TraverseDecl(Decl *D) { -if (isa(D) && isRefType(safeGetName(D))) +if (D && isa(D) && isRefType(safeGetName(D))) return true;

[clang] [clang] Enable C++17 relaxed template template argument matching by default (PR #89807)

2024-04-26 Thread Matheus Izvekov via cfe-commits
@@ -507,10 +507,62 @@ static TemplateDeductionResult DeduceNonTypeTemplateArgument( S, TemplateParams, NTTP, DeducedTemplateArgument(New), T, Info, Deduced); } +static NamedDecl *DeduceTemplateArguments(Sema , NamedDecl *A, +

[clang] [clang] Enable C++17 relaxed template template argument matching by default (PR #89807)

2024-04-26 Thread Matheus Izvekov via cfe-commits
@@ -507,10 +507,62 @@ static TemplateDeductionResult DeduceNonTypeTemplateArgument( S, TemplateParams, NTTP, DeducedTemplateArgument(New), T, Info, Deduced); } +static NamedDecl *DeduceTemplateArguments(Sema , NamedDecl *A, +

[clang] [clang] Enable C++17 relaxed template template argument matching by default (PR #89807)

2024-04-26 Thread Matheus Izvekov via cfe-commits
@@ -0,0 +1,115 @@ +// RUN: %clang_cc1 %s -fsyntax-only -std=c++23 -verify=expected,new +// RUN: %clang_cc1 %s -fsyntax-only -std=c++23 -fno-relaxed-template-template-args -verify=expected,old mizvekov wrote: Thanks. Since

[clang] [clang] Enable C++17 relaxed template template argument matching by default (PR #89807)

2024-04-26 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov dismissed https://github.com/llvm/llvm-project/pull/89807 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Enable C++17 relaxed template template argument matching by default (PR #89807)

2024-04-26 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/89807 >From 43f813d0a1a87b6cad9b859237489778f4f2945f Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Tue, 9 Apr 2024 01:14:28 -0300 Subject: [PATCH] [clang] Enable C++17 relaxed template template argument

[clang] [clang] Enable C++17 relaxed template template argument matching by default (PR #89807)

2024-04-26 Thread Matheus Izvekov via cfe-commits
@@ -0,0 +1,115 @@ +// RUN: %clang_cc1 %s -fsyntax-only -std=c++23 -verify=expected,new mizvekov wrote: While it's true this is a DR, I just don't think for this particular case it's worth the cost of testing every single

[clang] [clang] Enable C++17 relaxed template template argument matching by default (PR #89807)

2024-04-26 Thread Matheus Izvekov via cfe-commits
@@ -0,0 +1,115 @@ +// RUN: %clang_cc1 %s -fsyntax-only -std=c++23 -verify=expected,new +// RUN: %clang_cc1 %s -fsyntax-only -std=c++23 -fno-relaxed-template-template-args -verify=expected,old mizvekov wrote: Okay, I think I

[clang] [clang] Enable C++17 relaxed template template argument matching by default (PR #89807)

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

[clang] [clang] deprecate frelaxed-template-template-args, make it on by default (PR #89807)

2024-04-26 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/89807 >From 3f6e50edc7b4d4bf4781c71bd29f48224b62822d Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Tue, 9 Apr 2024 01:14:28 -0300 Subject: [PATCH] [clang] Enable C++17 relaxed template template argument

[clang] [clang] deprecate frelaxed-template-template-args, make it on by default (PR #89807)

2024-04-24 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: So Jason pointed out that GCC's provisional wording for CWG2398 picks a dubious candidate for this example: ```C++ template struct match2; template class t1,typename T> struct match2, typename t1::type > { typedef int type; }; // #5

[clang] [clang] deprecate frelaxed-template-template-args, make it on by default (PR #89807)

2024-04-24 Thread Matheus Izvekov via cfe-commits
@@ -507,10 +507,62 @@ static TemplateDeductionResult DeduceNonTypeTemplateArgument( S, TemplateParams, NTTP, DeducedTemplateArgument(New), T, Info, Deduced); } +static NamedDecl *DeduceTemplateArguments(Sema , NamedDecl *A, +

[clang] [clang] deprecate frelaxed-template-template-args, make it on by default (PR #89807)

2024-04-24 Thread Matheus Izvekov via cfe-commits
@@ -519,13 +571,45 @@ DeduceTemplateArguments(Sema , TemplateParameterList *TemplateParams, return TemplateDeductionResult::Success; } - if (TemplateTemplateParmDecl *TempParam -= dyn_cast(ParamDecl)) { + if (auto *TempParam = dyn_cast(ParamDecl)) { //

[clang] [clang] deprecate frelaxed-template-template-args, make it on by default (PR #89807)

2024-04-24 Thread Matheus Izvekov via cfe-commits
@@ -1133,8 +1133,8 @@ C++17 implementation status Matching template template parameters to compatible arguments - https://wg21.link/p0522r0;>P0522R0 - Partial (10) + https://wg21.link/p0522r0;>P0522R0 (DR) + Clang 4 (10)

[clang] [clang] deprecate frelaxed-template-template-args, make it on by default (PR #89807)

2024-04-24 Thread Matheus Izvekov via cfe-commits
@@ -507,10 +507,62 @@ static TemplateDeductionResult DeduceNonTypeTemplateArgument( S, TemplateParams, NTTP, DeducedTemplateArgument(New), T, Info, Deduced); } +static NamedDecl *DeduceTemplateArguments(Sema , NamedDecl *A, +

[clang] [clang] deprecate frelaxed-template-template-args, make it on by default (PR #89807)

2024-04-24 Thread Matheus Izvekov via cfe-commits
@@ -8343,58 +8343,52 @@ bool Sema::CheckTemplateTemplateArgument(TemplateTemplateParmDecl *Param, // C++1z [temp.arg.template]p3: (DR 150) // A template-argument matches a template template-parameter P when P // is at least as specialized as the template-argument A.

[clang] [clang] deprecate frelaxed-template-template-args, make it on by default (PR #89807)

2024-04-24 Thread Matheus Izvekov via cfe-commits
@@ -507,10 +507,62 @@ static TemplateDeductionResult DeduceNonTypeTemplateArgument( S, TemplateParams, NTTP, DeducedTemplateArgument(New), T, Info, Deduced); } +static NamedDecl *DeduceTemplateArguments(Sema , NamedDecl *A, +

[clang] [clang] deprecate frelaxed-template-template-args, make it on by default (PR #89807)

2024-04-24 Thread Matheus Izvekov via cfe-commits
@@ -507,10 +507,62 @@ static TemplateDeductionResult DeduceNonTypeTemplateArgument( S, TemplateParams, NTTP, DeducedTemplateArgument(New), T, Info, Deduced); } +static NamedDecl *DeduceTemplateArguments(Sema , NamedDecl *A, +

[clang] [clang] deprecate frelaxed-template-template-args, make it on by default (PR #89807)

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

[clang] [clang] deprecate frelaxed-template-template-args, make it on by default (PR #89807)

2024-04-23 Thread Matheus Izvekov via cfe-commits
@@ -8343,58 +8343,52 @@ bool Sema::CheckTemplateTemplateArgument(TemplateTemplateParmDecl *Param, // C++1z [temp.arg.template]p3: (DR 150) // A template-argument matches a template template-parameter P when P // is at least as specialized as the template-argument A.

[clang] [clang] deprecate frelaxed-template-template-args, make it on by default (PR #89807)

2024-04-23 Thread Matheus Izvekov via cfe-commits
@@ -8343,58 +8343,52 @@ bool Sema::CheckTemplateTemplateArgument(TemplateTemplateParmDecl *Param, // C++1z [temp.arg.template]p3: (DR 150) // A template-argument matches a template template-parameter P when P // is at least as specialized as the template-argument A.

[clang] [clang] deprecate frelaxed-template-template-args, make it on by default (PR #89807)

2024-04-23 Thread Matheus Izvekov via cfe-commits
@@ -8343,58 +8343,52 @@ bool Sema::CheckTemplateTemplateArgument(TemplateTemplateParmDecl *Param, // C++1z [temp.arg.template]p3: (DR 150) // A template-argument matches a template template-parameter P when P // is at least as specialized as the template-argument A.

[clang] [clang] deprecate frelaxed-template-template-args, make it on by default (PR #89807)

2024-04-23 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/89807 This patch will finally allow us to mark C++17 support in clang as complete. This is a continuation of the review process from an [old PR in phab](https://reviews.llvm.org/D109496). Recap: The original patch

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

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

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-22 Thread Matheus Izvekov via cfe-commits
@@ -13456,6 +13458,15 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { return; } + if (VDecl->isInvalidDecl()) { +CorrectDelayedTyposInExpr(Init, VDecl); +ExprResult Recovery = +CreateRecoveryExpr(Init->getBeginLoc(),

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

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

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-22 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov deleted https://github.com/llvm/llvm-project/pull/88645 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-22 Thread Matheus Izvekov via cfe-commits
@@ -13456,6 +13458,15 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { return; } + if (VDecl->isInvalidDecl()) { +CorrectDelayedTyposInExpr(Init, VDecl); +ExprResult Recovery = +CreateRecoveryExpr(Init->getBeginLoc(),

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

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

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

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

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

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

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-22 Thread Matheus Izvekov via cfe-commits
@@ -13435,16 +13435,18 @@ void Sema::checkNonTrivialCUnion(QualType QT, SourceLocation Loc, void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { // If there is no declaration, there was an error parsing it. Just ignore // the initializer. - if

[clang] [clang] Fix high memory consumption during pack deduction (PR #88637)

2024-04-18 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @term-est It would be helpful if you could post the surrounding code context where this crashed, This is pointed at the top of the stacktrace: ``` 0. /home/est/Working-Directory/DS/wetend-emulator-new/WetendEmulator.hpp:85:128: current parser token ')' ``` You said, and

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-18 Thread Matheus Izvekov via cfe-commits
@@ -3647,15 +3647,28 @@ class IsTypeDeclaredInsideVisitor }; } // namespace -/// This function checks if the function has 'auto' return type that contains +/// This function checks if the given function has a return type that contains /// a reference (in any way) to a

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

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

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Matheus Izvekov via cfe-commits
@@ -3647,15 +3647,19 @@ class IsTypeDeclaredInsideVisitor }; } // namespace -/// This function checks if the function has 'auto' return type that contains +/// This function checks if the given function has a return type that contains /// a reference (in any way) to a

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Matheus Izvekov via cfe-commits
@@ -3647,15 +3647,19 @@ class IsTypeDeclaredInsideVisitor }; } // namespace -/// This function checks if the function has 'auto' return type that contains +/// This function checks if the given function has a return type that contains /// a reference (in any way) to a

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Matheus Izvekov via cfe-commits
@@ -3647,15 +3647,19 @@ class IsTypeDeclaredInsideVisitor }; } // namespace -/// This function checks if the function has 'auto' return type that contains +/// This function checks if the given function has a return type that contains /// a reference (in any way) to a

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > I tested this idea, might be like this: I meant something else. This patch makes it so the delayed function type importation happens unconditionally. I was aware that change would cause breakages. What I meant is that, we have a special sugar type node that marks deduction,

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Matheus Izvekov via cfe-commits
@@ -3649,19 +3649,15 @@ class IsTypeDeclaredInsideVisitor /// This function checks if the function has 'auto' return type that contains /// a reference (in any way) to a declaration inside the same function. mizvekov wrote: ```suggestion /// This function

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

2024-04-17 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: I think it would be a good idea to double check this for performance regressions, since this case will recurse into the function every time with this patch. Though I don't know if there is a better way to test it than to merge it and wait for it to be

[clang] [ASTImporter] Fix infinite recurse on return type declared inside body (#68775) (PR #89096)

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

[clang] Improve stack usage to increase recursive initialization depth (PR #88546)

2024-04-16 Thread Matheus Izvekov via cfe-commits
@@ -1070,57 +1077,24 @@ class Sema; }; private: -SmallVector Candidates; -llvm::SmallPtrSet Functions; - -// Allocator for ConversionSequenceLists. We store the first few of these -// inline to avoid allocation for small sets. -llvm::BumpPtrAllocator

[clang] Improve stack usage to increase recursive initialization depth (PR #88546)

2024-04-15 Thread Matheus Izvekov via cfe-commits
@@ -1070,57 +1077,24 @@ class Sema; }; private: -SmallVector Candidates; -llvm::SmallPtrSet Functions; - -// Allocator for ConversionSequenceLists. We store the first few of these -// inline to avoid allocation for small sets. -llvm::BumpPtrAllocator

[clang] [clang][Sema] Improve error recovery for id-expressions referencing invalid decls (PR #81662)

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

[clang] [clang][Sema] Improve error recovery for id-expressions referencing invalid decls (PR #81662)

2024-04-15 Thread Matheus Izvekov via cfe-commits
@@ -3453,6 +3453,10 @@ ExprResult Sema::BuildDeclarationNameExpr(const CXXScopeSpec , NeedsADL, R.isOverloadedResult(), R.begin(), R.end()); + if (ULE && R.isSingleResult() &&

[clang] [clang][Sema] Improve error recovery for id-expressions referencing invalid decls (PR #81662)

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

[clang] [clang][Sema] Improve error recovery for id-expressions referencing invalid decls (PR #81662)

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

[clang] [C++20] [Modules] Introduce -fexperimental-modules-reduced-bmi (PR #85050)

2024-04-14 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. I share the objections that it may be too soon to introduce a driver flag for this. Only a frontend flag is ok for now, but it's non blocking on my side because it doesn't look like it will be particularly hard to deprecate it later.

[clang] [C++20] [Modules] Introduce -fexperimental-modules-reduced-bmi (PR #85050)

2024-04-14 Thread Matheus Izvekov via cfe-commits
@@ -4045,6 +4045,24 @@ static bool RenderModulesOptions(Compilation , const Driver , // module fragment. CmdArgs.push_back("-fskip-odr-check-in-gmf"); + if (Args.hasArg(options::OPT_modules_reduced_bmi) && + (Input.getType() == driver::types::TY_CXXModule || +

[clang] [C++20] [Modules] Introduce -fexperimental-modules-reduced-bmi (PR #85050)

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

[clang] [C++20] [Modules] Introduce -fexperimental-modules-reduced-bmi (PR #85050)

2024-04-14 Thread Matheus Izvekov via cfe-commits
@@ -1061,6 +1070,16 @@ CodeGenAction::CreateASTConsumer(CompilerInstance , StringRef InFile) { CI.getPreprocessor().addPPCallbacks(std::move(Callbacks)); } + if (CI.getFrontendOpts().GenReducedBMI && + !CI.getFrontendOpts().ModuleOutputPath.empty()) { +

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-14 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov requested changes to this pull request. Thanks for the improvement! Can you also add a test case? https://github.com/llvm/llvm-project/pull/88645 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-14 Thread Matheus Izvekov via cfe-commits
@@ -13456,6 +13455,14 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { return; } + if (VDecl->isInvalidDecl()) { +CorrectDelayedTyposInExpr(Init, VDecl); +VDecl->setInit( +CreateRecoveryExpr(Init->getBeginLoc(),

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

2024-04-14 Thread Matheus Izvekov via cfe-commits
@@ -13435,8 +13435,7 @@ void Sema::checkNonTrivialCUnion(QualType QT, SourceLocation Loc, void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { // If there is no declaration, there was an error parsing it. Just ignore // the initializer. - if

[clang] [clang][Sema] Preserve the initializer of invalid VarDecls (PR #88645)

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

[clang] [clang][Index] Use canonical function parameter types in USRs (PR #68222)

2024-04-14 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @sdkrystian ping, do you still intend to continue this? Just adding your example as a test case would be fine. https://github.com/llvm/llvm-project/pull/68222 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Fix high memory consumption during pack deduction (PR #88637)

2024-04-14 Thread Matheus Izvekov via cfe-commits
@@ -831,7 +831,7 @@ class PackDeductionScope { if (IsPartiallyExpanded) PackElements += NumPartialPackArgs; else if (IsExpanded) - PackElements += *FixedNumExpansions; + PackElements += FixedNumExpansions.value_or(1); mizvekov wrote:

  1   2   3   4   >