[clang] [clang] fix serialization for SubstNonTypeTemplateParmPackExpr (PR #135428)

2025-04-11 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/135428 This fixes a PCM non-determinism regression reported here: https://github.com/llvm/llvm-project/pull/134560#issuecomment-2797744370 There was a bit in `SubstNonTypeTemplateParmPackExpr` which we missed to ser

[clang] [clang] WIP: Fix MemberPointer serialization non-determinism (PR #135434)

2025-04-11 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/135434 This fixes a problem originally reported here: https://github.com/llvm/llvm-project/pull/132401#issuecomment-2795078260 This makes sure we only serialize the class declaration when its strictly needed, and can

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

2025-04-11 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @eaeltsin speculative fix here, but can you try with this patch? https://github.com/llvm/llvm-project/pull/135434 https://github.com/llvm/llvm-project/pull/132401 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.ll

[clang] [clang-tools-extra] [llvm] Reland: [clang] Improved canonicalization for template specialization types (PR #135414)

2025-04-11 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/135414 >From 4ddc43a264d113f1a4bd889a269f47141ff878e5 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sat, 17 Sep 2022 18:07:28 +0200 Subject: [PATCH] Reland: [clang] Improved canonicalization for template speci

[clang] [clang-tools-extra] [llvm] Reland: [clang] Improved canonicalization for template specialization types (PR #135414)

2025-04-11 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/135414 >From 10f5545e9c779960ff23a06b4c293167ae3228fe Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sat, 17 Sep 2022 18:07:28 +0200 Subject: [PATCH] Reland: [clang] Improved canonicalization for template speci

[clang] [clang] fix serialization for SubstNonTypeTemplateParmPackExpr (PR #135428)

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

[clang] [clang-tools-extra] [llvm] Reland: [clang] Improved canonicalization for template specialization types (PR #135414)

2025-04-11 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/135414 >From 28981802c08eaffd67aeef1ad3516c1395d34250 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sat, 17 Sep 2022 18:07:28 +0200 Subject: [PATCH] Reland: [clang] Improved canonicalization for template speci

[clang] [clang-tools-extra] [llvm] Reland: [clang] Improved canonicalization for template specialization types (PR #135414)

2025-04-11 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/135414 >From c490e8d58a8052f59965b7d2a212adff07ab27df Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sat, 17 Sep 2022 18:07:28 +0200 Subject: [PATCH] Reland: [clang] Improved canonicalization for template speci

[clang] [clang-tools-extra] [llvm] Reland: [clang] Improved canonicalization for template specialization types (PR #135414)

2025-04-11 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Thanks, yeah this relanding was just to try to get LLDB CI up and running, which I am still trying. https://github.com/llvm/llvm-project/pull/135414 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[clang] [clang-tools-extra] [llvm] Reland: [clang] Improved canonicalization for template specialization types (PR #135414)

2025-04-11 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/135414 >From 5290f0918bff59121c289b7c1d32895aeb206be0 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sat, 17 Sep 2022 18:07:28 +0200 Subject: [PATCH] Reland: [clang] Improved canonicalization for template speci

[clang] [clang-tools-extra] [llvm] Reland: [clang] Improved canonicalization for template specialization types (PR #135414)

2025-04-11 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/135414 >From 9b055223142ee73cb784b15928d1993178f21646 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sat, 17 Sep 2022 18:07:28 +0200 Subject: [PATCH] Reland: [clang] Improved canonicalization for template speci

[clang] [clang-tools-extra] [llvm] Reland: [clang] Improved canonicalization for template specialization types (PR #135414)

2025-04-11 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/135414 >From 2d4b74fb9acde7a76051bd28b933897c3fbe811c Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sat, 17 Sep 2022 18:07:28 +0200 Subject: [PATCH] Reland: [clang] Improved canonicalization for template speci

[clang] [clang-tools-extra] [llvm] Reland: [clang] Improved canonicalization for template specialization types (PR #135414)

2025-04-11 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Thanks, that narrows it down a lot! I still wish I could test lldb locally. I will keep trying. https://github.com/llvm/llvm-project/pull/135414 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

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

2025-04-11 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Okay, if the problem is an uninitialized source location somewhere, then that patch doesn't help at all. https://github.com/llvm/llvm-project/pull/132401 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

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

2025-04-11 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Do you have a backtrace of that uninitialized read? https://github.com/llvm/llvm-project/pull/132401 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] ASTImporter: fix SubstNonTypeTemplateParmExpr source location (PR #135450)

2025-04-11 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/135450 This fixes an issue where an incorrect source location is imported. >From 7c53319c1e7ea35b8fab471b28403b1b84bc59b0 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Fri, 11 Apr 2025 19:41:02 -0300 Subject:

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

2025-04-11 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Thanks for that stack trace, could be unrelated to this, but that still helped find a bug: https://github.com/llvm/llvm-project/pull/135450 https://github.com/llvm/llvm-project/pull/132401 ___ cfe-commits mailing list cfe-commits@lists

[clang] [clang-tools-extra] [llvm] Reland: [clang] Improved canonicalization for template specialization types (PR #135414)

2025-04-11 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @slydiman Thanks. You can see I made changes to our CI in this PR, and I managed to enable lldb, enable python testing and everything, but everything still passes in the lldb test suite. This is a linux system, too it should be capable to reproduce this, right? Can you help

[clang] [clang] ASTImporter: fix SubstNonTypeTemplateParmExpr source location (PR #135450)

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

[clang] [clang-tools-extra] [llvm] Reland: [clang] Improved canonicalization for template specialization types (PR #135414)

2025-04-11 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/135414 >From f7b9634b0200bdd45dfcdffd8fc8c077ca02 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sat, 17 Sep 2022 18:07:28 +0200 Subject: [PATCH 1/2] Reland: [clang] Improved canonicalization for template s

[clang] [clang] ASTImporter: fix SubstNonTypeTemplateParmExpr source location (PR #135450)

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

[clang] [clang-tools-extra] [llvm] Reland: [clang] Improved canonicalization for template specialization types (PR #135414)

2025-04-11 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/135414 >From f7b9634b0200bdd45dfcdffd8fc8c077ca02 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sat, 17 Sep 2022 18:07:28 +0200 Subject: [PATCH 1/2] Reland: [clang] Improved canonicalization for template s

[clang] [clang-tools-extra] [llvm] Reland: [clang] Improved canonicalization for template specialization types (PR #135414)

2025-04-11 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Nevermind, I managed to do it :) https://github.com/llvm/llvm-project/pull/135414 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] Reland: [clang] Improved canonicalization for template specialization types (PR #135414)

2025-04-11 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/135414 >From f7b9634b0200bdd45dfcdffd8fc8c077ca02 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sat, 17 Sep 2022 18:07:28 +0200 Subject: [PATCH 1/3] Reland: [clang] Improved canonicalization for template s

[clang] [clang] fix serialization of SubstNonTypeTemplateParmExpr (PR #134560)

2025-04-06 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/134560 This fixes a couple of mistakes introduced when merging https://github.com/llvm/llvm-project/pull/132748 Fixes msan failure reported here: https://github.com/llvm/llvm-project/pull/132748#issuecomment-2781105

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

2025-04-06 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: This will be fixed here: https://github.com/llvm/llvm-project/pull/134560 https://github.com/llvm/llvm-project/pull/132748 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] [clang] fix RecursiveASTVisitor traversal from type to decl (PR #132551)

2025-04-06 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Which host type twice? In case the MemberPointerType represents a class adjustment, this visits the actual class type, instead of just the as-written qualifier. example: https://gcc.godbolt.org/z/M5qfGPGMf I didn't expect we would have in-tree users of the RecursiveVisitor for

[clang] [clang-tools-extra] [clang] fix diagnostic printing of expressions ignoring LangOpts (PR #134693)

2025-04-07 Thread Matheus Izvekov via cfe-commits
@@ -493,8 +493,8 @@ DeduceNullPtrTemplateArgument(Sema &S, TemplateParameterList *TemplateParams, : CK_NullToPointer) .get(); return DeduceNonTypeTemplateArgument( - S, TemplateParams, NTTP, Ded

[clang] [clang-tools-extra] [clang] fix diagnostic printing of expressions ignoring LangOpts (PR #134693)

2025-04-07 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/134693 Currently when printing a template argument of expression type, the expression is converted immediately into a string to be sent to the diagnostic engine, unsing a fake LangOpts. This makes the expression pri

[clang] [clang] fix unresolved dependent template specialization mangling (PR #136201)

2025-04-17 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/136201 This fixes a regression introduced in #133610 which was reported here #133610 (comment) and in #136119 This redoes previous attempt in #135111 When mangling a DTST which appears in the prefix, the template na

[clang] [clang] fix unresolved dependent template specialization mangling (PR #135111)

2025-04-17 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @usx95 that reproducer is fixed by https://github.com/llvm/llvm-project/pull/136201 as well. https://github.com/llvm/llvm-project/pull/135111 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [cindex] Add support for calling getFullyQualifiedName to the Python binding. (PR #135420)

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

[clang] [clang] Mark some language options as benign. (PR #131569)

2025-04-14 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I think one option would be to allow differences in macros, and rely on the ODR checker to catch when that would cause problems. https://github.com/llvm/llvm-project/pull/131569 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

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

2025-04-14 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Could it be you are hitting an overflow/wrap around perhaps? Some of these nodes store the unsignedOrNone representation in a bitfield, but that's still 15 bits. https://github.com/llvm/llvm-project/pull/132401 ___ cfe-commits mailing

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

2025-04-14 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: In one of these changes we did bump one of these bit fields down to 15 bits, starting from 16. https://github.com/llvm/llvm-project/pull/132401 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [clang] Handle instantiated members to determine visibility (PR #136128)

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

[clang] [clang] fix unresolved dependent template specialization mangling (PR #136201)

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

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

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

[clang] Reland [clang] Handle instantiated members to determine visibility (#136128) (PR #136689)

2025-04-22 Thread Matheus Izvekov via cfe-commits
@@ -4787,8 +4787,10 @@ LinkageInfo LinkageComputer::computeTypeLinkageInfo(const Type *T) { return computeTypeLinkageInfo(cast(T)->getPointeeType()); case Type::MemberPointer: { const auto *MPT = cast(T); -LinkageInfo LV = -getDeclLinkageAndVisibility(MPT

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

2025-04-23 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @emaxx-google thanks for the reproducer. I will be off to C++Now soon, so it's unlikely I will have time to take a look at that in the next two weeks, sorry about that. https://github.com/llvm/llvm-project/pull/132401 ___ cfe-commits

[clang] [Clang] Make the result type of sizeof/pointer subtraction/size_t lit… (PR #136542)

2025-04-23 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: If you make it a canonical node, you also automatically don't get an `aka` in diagnostics, which might be an advantage (or not). Ie you avoid the aka in `size_t (aka 'unsigned long')` you currently get. https://github.com/llvm/llvm-project/pull/136542 __

[clang] [Clang] Make the result type of sizeof/pointer subtraction/size_t lit… (PR #136542)

2025-04-23 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: With template specialization resugaring, these being typedefs still help somewhat: https://compiler-explorer.com/z/qKxbYMEGq You have to make a bit of contortion to expose the intermediate type, but I think that's partly due to a different problem, where in diagnostics we don't

[clang] [clang] fix unresolved dependent template specialization mangling (PR #135111)

2025-04-24 Thread Matheus Izvekov via cfe-commits
@@ -399,3 +399,20 @@ namespace type_qualifier { // CHECK: @_ZN14type_qualifier1gIPiEEvDTcmcvv_ELi1EE template void g(int); } + +namespace unresolved_template_specialization_type { + template struct enable_if {}; + struct Foo { +static const int value = true; + }; +

[clang] [clang] Fix nondeterminism in MemberPointerType (PR #137910)

2025-04-30 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: I won't have time to review this closely until next week. I think the 'inside profile' is a red herring here, this looks more like a problem from calling it from within deserialization. We could try getting to the bottom of it and see if we can assert in

[clang] [clang-tools-extra] [clang] fix diagnostic printing of expressions ignoring LangOpts (PR #134693)

2025-04-10 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/134693 >From 3ccb34773d143d3ef6a153ecc433db4791ee85f5 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 7 Apr 2025 13:08:52 -0300 Subject: [PATCH] [clang] fix diagnostic printing of expressions ignoring LangO

[clang] [clang-tools-extra] [libcxx] [clang] fix diagnostic printing of expressions ignoring LangOpts (PR #134693)

2025-04-10 Thread Matheus Izvekov via cfe-commits
@@ -7379,6 +7379,14 @@ class RecoveryExpr final : public Expr, friend class ASTStmtWriter; }; +/// Insertion operator for diagnostics. This allows sending +/// Expr into a diagnostic with <<. +inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB, +

[clang] [clang] ItaniumMangle: fix mangling for unresolved types (PR #135312)

2025-04-10 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/135312 This fixes a regression introduced here: https://github.com/llvm/llvm-project/pull/132748 which was originally reported here: https://github.com/llvm/llvm-project/pull/132748#issuecomment-2791012454 Some time

[clang] [clang-tools-extra] [clang] implement printing of canonical template arguments of expression kind (PR #135133)

2025-04-10 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/135133 >From 77ee135557937d14021001ce58f6c5ab5f79fe6c Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Thu, 10 Apr 2025 02:52:36 -0300 Subject: [PATCH] [clang] implement printing of canonical template arguments of

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

2025-04-10 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @pranavk this will be fixed by https://github.com/llvm/llvm-project/pull/135312 https://github.com/llvm/llvm-project/pull/132748 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[clang] [clang-tools-extra] [clang] fix diagnostic printing of expressions ignoring LangOpts (PR #134693)

2025-04-10 Thread Matheus Izvekov via cfe-commits
@@ -493,8 +493,8 @@ DeduceNullPtrTemplateArgument(Sema &S, TemplateParameterList *TemplateParams, : CK_NullToPointer) .get(); return DeduceNonTypeTemplateArgument( - S, TemplateParams, NTTP, Ded

[clang] [clang-tools-extra] [clang] implement printing of canonical expressions (PR #135133)

2025-04-13 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/135133 >From aaf5482c91f73431e1290cab640d01f4b3f39692 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Thu, 10 Apr 2025 02:52:36 -0300 Subject: [PATCH] [clang] implement printing of canonical expressions This pat

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

2025-04-14 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: One thing that looks fishy, but that is even a different node, is this early return on `VisitSubstNonTypeTemplateParmPackExpr` in `ASTReaderStmt`. ```C++ if (ArgPack.getKind() != TemplateArgument::Pack) return; ``` This looks impossible to hit, because `getArgumentPack` c

[clang] [clang] consistently quote expressions in diagnostics (PR #134769)

2025-04-14 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I plan to merge this tomorrow if there are no further comments. https://github.com/llvm/llvm-project/pull/134769 ___ 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 printing of canonical expressions (PR #135133)

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

[clang] [clang] remove unused frontend flag -fretain-subst-template-type-parm-type-ast-nodes (PR #134177)

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

[clang] [clang-tools-extra] Reland: [clang] Improved canonicalization for template specialization types (PR #135414)

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

[clang] [clang-tools-extra] Reland: [clang] Improved canonicalization for template specialization types (PR #135414)

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

[clang] [clang-tools-extra] Reland: [clang] Improved canonicalization for template specialization types (PR #135414)

2025-04-12 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/135414 ___ 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 printing of canonical expressions (PR #135133)

2025-04-12 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/135133 ___ 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 printing of canonical template arguments of expression kind (PR #135133)

2025-04-12 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/135133 >From 6876f4a602b44d587eb62163acd3e769b212b40b Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Thu, 10 Apr 2025 02:52:36 -0300 Subject: [PATCH] [clang] implement printing of canonical expressions This pat

[clang] [clang-tools-extra] [clang] implement printing of canonical expressions (PR #135133)

2025-04-12 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I've added a few test cases showing the effects on diagnostics. Which is likely to be short lived, as the underlying issue looks easy to solve. I have updated the patch to cover printing of dependent decltype as well. I have looked into also covering DependentSizedArrays, but th

[clang] [clang-tools-extra] [clang] implement printing of canonical expressions (PR #135133)

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

[clang] [clang] AST: remove source locations from [Variable/Dependent]SizedArrayType (PR #135511)

2025-04-12 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/135511 Source locations should be handled at the TypeLoc level, and these locations are already wired up to the base ArrayLoc. There was nothing important using these, so just remove. >From e01aa7b78e6b1971e2fedbcad7

[clang] [clang] fix a crash in error recovery in expressions resolving to templates (PR #135893)

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

[clang] [clang] Fix elaborated keyword canonicalization (PR #135916)

2025-04-16 Thread Matheus Izvekov via cfe-commits
@@ -1938,6 +1938,17 @@ TagDecl *Type::getAsTagDecl() const { return nullptr; } +const TemplateSpecializationType * +Type::getAsNonAliasTemplateSpecializationType() const { + for (const auto *T = this; /**/; /**/) { +const TemplateSpecializationType *TST = +T->ge

[clang] [clang] Fix elaborated keyword canonicalization (PR #135916)

2025-04-16 Thread Matheus Izvekov via cfe-commits
@@ -1938,6 +1938,17 @@ TagDecl *Type::getAsTagDecl() const { return nullptr; } +const TemplateSpecializationType * +Type::getAsNonAliasTemplateSpecializationType() const { + for (const auto *T = this; /**/; /**/) { +const TemplateSpecializationType *TST = +T->ge

[clang] [clang] Fix elaborated keyword canonicalization (PR #135916)

2025-04-16 Thread Matheus Izvekov via cfe-commits
@@ -1938,6 +1938,17 @@ TagDecl *Type::getAsTagDecl() const { return nullptr; } +const TemplateSpecializationType * +Type::getAsNonAliasTemplateSpecializationType() const { + for (const auto *T = this; /**/; /**/) { +const TemplateSpecializationType *TST = +T->ge

[clang] [clang] Fix elaborated keyword canonicalization (PR #135916)

2025-04-16 Thread Matheus Izvekov via cfe-commits
@@ -2838,6 +2838,18 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase { /// immediately following this class. template const T *getAs() const; + /// Look through sugar for an instance of TemplateSpecializationType which + /// is not a type alias. +

[clang] [clang] Fix elaborated keyword canonicalization (PR #135916)

2025-04-16 Thread Matheus Izvekov via cfe-commits
@@ -2838,6 +2838,18 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase { /// immediately following this class. template const T *getAs() const; + /// Look through sugar for an instance of TemplateSpecializationType which + /// is not a type alias. +

[clang] [clang-tools-extra] [clang] Fix elaborated keyword canonicalization (PR #135916)

2025-04-16 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/135916 >From 0bdab9c8e1093eaa80bae640385e4ad7714e4a95 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Tue, 15 Apr 2025 02:55:50 -0300 Subject: [PATCH 1/2] [clang] preserve sugar on initializer_list deduction ---

[clang] Reapply "[Clang] Fix dependent local class instantiation bugs" (PR #135914)

2025-04-16 Thread Matheus Izvekov via cfe-commits
@@ -347,7 +347,7 @@ ParsedType Sema::getDestructorName(const IdentifierInfo &II, QualType T = CheckTypenameType(ElaboratedTypeKeyword::None, SourceLocation(), SS.getWithLocInContext(Context), II, NameLoc); -return ParsedType::make(T); +

[clang] [clang-tools-extra] [clang] Fix elaborated keyword canonicalization (PR #135916)

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

[clang] Users/mizvekov/dependent elab keyword fixes (PR #135916)

2025-04-15 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/135916 This patches makes the rules for canonicalization of the elaborated keyword uniform between DependentNameType and DependentTemplateSpecializationType. `class` and `struct` keywords are functionally equivalent,

[clang] [clang] Fix elaborated keyword canonicalization (PR #135916)

2025-04-15 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/135916 ___ 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-05-05 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @ziqingluo-90 I had already responded here: https://github.com/llvm/llvm-project/issues/130778#issuecomment-2843256610 I think you moved your post between issues after I had responded. https://github.com/llvm/llvm-project/pull/124137

[clang] [Clang] Make the result type of sizeof/pointer subtraction/size_t lit… (PR #136542)

2025-04-23 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: If the reason to even consider doing this as a new builtin type is due to templates, please don't do that. The better alternative here is to wait for template specialization resugaring to land. https://github.com/llvm/llvm-project/pull/136542 __

[clang] [Clang] Make the result type of sizeof/pointer subtraction/size_t lit… (PR #136542)

2025-04-23 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: You can still do that with a "builtin-type as sugar" approach, you just have to make it a non-canonical node (ie `isSugared()` returns true). It's one of the options, and whether we print an aka or not is still a diagnostic policy (we should do it only if it's relevant, but our

[clang] [Clang] Make the result type of sizeof/pointer subtraction/size_t lit… (PR #136542)

2025-04-23 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > The main purpose is for these expressions, with templates being just one > possible beneficiary. Sure, but outside of templates, all forms of type sugar are preserved just fine in the current implementation, so there would be no particular reason to pursue a different builti

[clang] [clang] fix unresolved dependent template specialization mangling (PR #135111)

2025-04-24 Thread Matheus Izvekov via cfe-commits
@@ -399,3 +399,20 @@ namespace type_qualifier { // CHECK: @_ZN14type_qualifier1gIPiEEvDTcmcvv_ELi1EE template void g(int); } + +namespace unresolved_template_specialization_type { + template struct enable_if {}; + struct Foo { +static const int value = true; + }; +

[clang] c7fbaba - [clang] fix typo in CHECK line

2025-04-24 Thread Matheus Izvekov via cfe-commits
Author: Matheus Izvekov Date: 2025-04-24T13:01:39-03:00 New Revision: c7fbabaf87f9411fbcc48a33efaa76f0f03135e9 URL: https://github.com/llvm/llvm-project/commit/c7fbabaf87f9411fbcc48a33efaa76f0f03135e9 DIFF: https://github.com/llvm/llvm-project/commit/c7fbabaf87f9411fbcc48a33efaa76f0f03135e9.dif

[clang] [Clang] Fix dependent local class instantiation bugs (PR #134038)

2025-04-15 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Can you send reproducer and / or stack trace? FYI you can use `CLANG_CRASH_DIAGNOSTICS_DIR` environment variable to make clang put these automatically generated reproducers up in a directory which will have its contents exported as artifacts. https://github.com/llvm/llvm-proje

[clang] [Clang] Handle default template arguments for alias CTAD guides (PR #134807)

2025-04-15 Thread Matheus Izvekov via cfe-commits
@@ -690,6 +690,23 @@ SmallVector TemplateParamsReferencedInTemplateArgumentList( SemaRef.MarkUsedTemplateParameters( DeducedArgs, TemplateParamsList->getDepth(), ReferencedTemplateParams); + auto MarkDefaultArgs = [&](auto *Param) { +if (!Param || !Param->hasDefa

[clang] [clang] AST: remove source locations from [Variable/Dependent]SizedArrayType (PR #135511)

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

[clang] [clang] Unify `SourceLocation` and `IdentifierInfo*` pair-like data structures to `IdentifierLoc` (PR #135808)

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

[clang] [clang] Unify `SourceLocation` and `IdentifierInfo*` pair-like data structures to `IdentifierLoc` (PR #135808)

2025-04-15 Thread Matheus Izvekov via cfe-commits
@@ -466,6 +467,29 @@ class FullSourceLoc : public SourceLocation { } }; +/// A simple pair of identifier info and location. +class IdentifierLoc { + SourceLocation Loc; + IdentifierInfo *II = nullptr; + +public: + IdentifierLoc() = default; + IdentifierLoc(SourceLocation

[clang] [clang] Unify `SourceLocation` and `IdentifierInfo*` pair-like data structures to `IdentifierLoc` (PR #135808)

2025-04-15 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: Thanks, I like the idea! https://github.com/llvm/llvm-project/pull/135808 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-04-10 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > We are now seeing non-determinism in `.pcm` files that root-causes to this > commit. > > @mizvekov - might it be something obvious, like pointer-keyed containers or > similar? I don't see anything obvious. The only parts of the patch which touch anything similar to pointer-

[clang] [clang] consistently quote expressions in diagnostics (PR #134769)

2025-04-10 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/134769 >From 36a48fabac5cdba181532a03be493260b6fd07db Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 7 Apr 2025 22:44:20 -0300 Subject: [PATCH] [clang] consistently quote expressions in diagnostics This ch

[clang] [clang] consistently quote expressions in diagnostics (PR #134769)

2025-04-14 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/134769 >From 7fe930def5714c196d003e94bafdb4639cea3a43 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 7 Apr 2025 22:44:20 -0300 Subject: [PATCH] [clang] consistently quote expressions in diagnostics This ch

[clang] [clang] consistently quote expressions in diagnostics (PR #134769)

2025-04-14 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/134769 >From e2c40042553845125914e544e696d7e21b553e7d Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 7 Apr 2025 22:44:20 -0300 Subject: [PATCH] [clang] consistently quote expressions in diagnostics This ch

[clang] [Clang] Fix dependent local class instantiation bugs (PR #134038)

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

[clang] [clang] consistently quote expressions in diagnostics (PR #134769)

2025-04-14 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/134769 >From 7a777961125a31a8e721f2f78354a3b21c0a06b2 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 7 Apr 2025 22:44:20 -0300 Subject: [PATCH] [clang] consistently quote expressions in diagnostics This ch

[clang] [clang] consistently quote expressions in diagnostics (PR #134769)

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

[clang] [clang] fix a crash in error recovery in expressions resolving to templates (PR #135893)

2025-04-15 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/135893 We were using AssumedTemplate incorrectly for error recovery. Fixes #135621 >From c2a06ac2819014546e60202ce520e5e327f53e5f Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Tue, 15 Apr 2025 21:54:04 -0300

[clang] [clang] fix a crash in error recovery in expressions resolving to templates (PR #135893)

2025-04-15 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/135893 >From 9f3ea29b57cf9d6611073e3235e79490614e9a05 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Tue, 15 Apr 2025 21:54:04 -0300 Subject: [PATCH] [clang] fix a crash in error recovery in expressions resolvi

[clang] [clang] fix a crash in error recovery in expressions resolving to templates (PR #135893)

2025-04-15 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/135893 >From c52264e0cebe9e32cb92670779e8fb07e63eca5a Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Tue, 15 Apr 2025 21:54:04 -0300 Subject: [PATCH] [clang] fix a crash in error recovery in expressions resolvi

[clang] [clang] fix a crash in error recovery in expressions resolving to templates (PR #135893)

2025-04-15 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/135893 >From d06164cda2bccc398a49bbbfadb728184ff6cb73 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Tue, 15 Apr 2025 21:54:04 -0300 Subject: [PATCH] [clang] fix a crash in error recovery in expressions resolvi

[clang] [Clang] Handle default template arguments for alias CTAD guides (PR #134807)

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

[clang] [clang] Add test for QualTypes in template class NNS (PR #137804)

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

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

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

<    9   10   11   12   13   14   15   16   17   >