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

2025-01-27 Thread Matheus Izvekov via cfe-commits
@@ -875,7 +875,41 @@ void TextNodeDumper::dumpBareDeclRef(const Decl *D) { if (const NamedDecl *ND = dyn_cast(D)) { ColorScope Color(OS, ShowColors, DeclNameColor); -OS << " '" << ND->getDeclName() << '\''; +if (DeclarationName Name = ND->getDeclName()) + OS

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

2025-01-27 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/124605 >From cf6413e220574adac3c89b28cc5011050ce11144 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 27 Jan 2025 15:08:01 -0300 Subject: [PATCH 1/2] NFC: convert clang/test/AST/HLSL/StructuredBuffers-AST.h

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

2025-01-27 Thread Matheus Izvekov via cfe-commits
@@ -875,7 +875,41 @@ void TextNodeDumper::dumpBareDeclRef(const Decl *D) { if (const NamedDecl *ND = dyn_cast(D)) { ColorScope Color(OS, ShowColors, DeclNameColor); -OS << " '" << ND->getDeclName() << '\''; +if (DeclarationName Name = ND->getDeclName()) + OS

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

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

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

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

[clang] eb10e94 - NFC: convert clang/test/AST/HLSL/StructuredBuffers-AST.hlsl to unix line endings

2025-01-28 Thread Matheus Izvekov via cfe-commits
Author: Matheus Izvekov Date: 2025-01-28T15:48:34-03:00 New Revision: eb10e94180dd722cf54cfaf1ed9d32aa0bb134a0 URL: https://github.com/llvm/llvm-project/commit/eb10e94180dd722cf54cfaf1ed9d32aa0bb134a0 DIFF: https://github.com/llvm/llvm-project/commit/eb10e94180dd722cf54cfaf1ed9d32aa0bb134a0.dif

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

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

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

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

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

2025-01-28 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/124386 >From 8cf1056761d23fe3191d1ac3421da350b7404eb1 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Fri, 24 Jan 2025 19:25:38 -0300 Subject: [PATCH] [clang] fix template argument conversion Converted template

[clang] [clang] NFC: cleanup check template argument (PR #124668)

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

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

2025-01-28 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: The test case provided shows a bug in the original implementation of the analyzer anyway. Here is the clang output for the slightly reduced repro: ```C++ struct A { static A a; char b; friend bool operator==(A, A) = default; }; bool _ = A() == A::a; ``` Original clang out

[clang] Reland: [clang] improve print / dump of anonymous declarations (PR #124858)

2025-01-28 Thread Matheus Izvekov via cfe-commits
@@ -1257,28 +1257,48 @@ void StmtPrinter::VisitConstantExpr(ConstantExpr *Node) { } void StmtPrinter::VisitDeclRefExpr(DeclRefExpr *Node) { - if (const auto *OCED = dyn_cast(Node->getDecl())) { + ValueDecl *VD = Node->getDecl(); + if (const auto *OCED = dyn_cast(VD)) {

[clang] Reland: [clang] improve print / dump of anonymous declarations (PR #124858)

2025-01-28 Thread Matheus Izvekov via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG -triple x86_64-apple-darwin12 -std=c++20 %s 2>&1 | FileCheck %s + +struct A { + static A a; + char b; + friend bool operator==(A, A) = default; +}; +bool _ = A() == A::a; + +// CHECK-LABEL: bool opera

[clang] [clang] NFC: cleanup check template argument (PR #124668)

2025-01-28 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/124668 >From c6bfaae1908fec0b867ba5adc47b4043cbf5900e Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 27 Jan 2025 19:18:27 -0300 Subject: [PATCH] [clang] NFC: cleanup check template argument --- clang/incl

[clang] Reland: [clang] improve print / dump of anonymous declarations (PR #124858)

2025-01-28 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/124858 >From bdcb8e21182f23fa39b5bba1b5d523f93d3d0ff1 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 27 Jan 2025 01:04:47 -0300 Subject: [PATCH] [clang] improve print / dump of anonymous declarations ast-p

[clang] Reland: [clang] improve print / dump of anonymous declarations (PR #124858)

2025-01-28 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/124858 >From dcf882d61f09c3218f1df372e4dbc82406820f8d Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 27 Jan 2025 01:04:47 -0300 Subject: [PATCH] [clang] improve print / dump of anonymous declarations ast-p

[clang] [clang] NFC: cleanup check template argument (PR #124668)

2025-01-28 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Changes to DR tests look good. No changes to test, that was just noise from GitHub auto-rebasing, sorry about that. https://github.com/llvm/llvm-project/pull/124668 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[clang] [Clang][Driver] Add new flags to control machine instruction verification (PR #70282)

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

[clang] [clang] NFC: cleanup check template argument (PR #124668)

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

[clang] Reland: [clang] improve print / dump of anonymous declarations (PR #124858)

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

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

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

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

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

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

2025-01-28 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/124498 >From 0e3246e46820df6d13ea623e20c8226c571d4f9a Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 27 Jan 2025 00:04:59 -0300 Subject: [PATCH] [clang] fix nondeduced mismatch with nullptr template argume

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

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

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

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

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

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

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

2025-01-29 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/124997 None >From ea6f1cbcdea32d5554c6be962b4e79b23d7471ed Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Wed, 29 Jan 2025 19:34:24 -0300 Subject: [PATCH] [clang] C++20 Modules: document how to perform automate

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

2025-01-29 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/125001 >From 7e687ef989c8eceba8060e95bd7c19dfdb6af19b Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Wed, 29 Jan 2025 21:07:15 -0300 Subject: [PATCH] [clang] StmtPrinter: Handle DeclRefExpr to a Decomposition A

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

2025-01-29 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/125001 A DeclRefExpr could never refer to a Decomposition in valid C++ code, but somehow the Analyzer creates these entities and then it tries to print them. There is no sensible answer here, so we print 'decompositi

[clang] Reland: [clang] improve print / dump of anonymous declarations (PR #124858)

2025-01-29 Thread Matheus Izvekov via cfe-commits
@@ -1257,28 +1257,48 @@ void StmtPrinter::VisitConstantExpr(ConstantExpr *Node) { } void StmtPrinter::VisitDeclRefExpr(DeclRefExpr *Node) { - if (const auto *OCED = dyn_cast(Node->getDecl())) { + ValueDecl *VD = Node->getDecl(); + if (const auto *OCED = dyn_cast(VD)) {

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

2025-01-29 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/124997 >From 087997a38f4c64f7c305142ca630777d35b6a126 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Wed, 29 Jan 2025 19:34:24 -0300 Subject: [PATCH] [clang] C++20 Modules: document how to perform automated red

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

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

[clang] [clang] Track function template instantiation from definition (PR #112241)

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

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

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

[clang] Reland: [clang] improve print / dump of anonymous declarations (PR #124858)

2025-01-29 Thread Matheus Izvekov via cfe-commits
@@ -1257,28 +1257,48 @@ void StmtPrinter::VisitConstantExpr(ConstantExpr *Node) { } void StmtPrinter::VisitDeclRefExpr(DeclRefExpr *Node) { - if (const auto *OCED = dyn_cast(Node->getDecl())) { + ValueDecl *VD = Node->getDecl(); + if (const auto *OCED = dyn_cast(VD)) {

[clang] Reland: [clang] improve print / dump of anonymous declarations (PR #124858)

2025-01-29 Thread Matheus Izvekov via cfe-commits
@@ -1257,28 +1257,48 @@ void StmtPrinter::VisitConstantExpr(ConstantExpr *Node) { } void StmtPrinter::VisitDeclRefExpr(DeclRefExpr *Node) { - if (const auto *OCED = dyn_cast(Node->getDecl())) { + ValueDecl *VD = Node->getDecl(); + if (const auto *OCED = dyn_cast(VD)) {

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

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

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

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

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

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

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

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

[clang] [clang] Remove the deprecated flag `-frelaxed-template-template-args`. (PR #111894)

2025-01-29 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/111894 >From 9bfdecf255d83794108d7d7ae507dbf8c5bdb156 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Thu, 10 Oct 2024 15:40:48 -0300 Subject: [PATCH] [clang] Remove the deprecated flag `-frelaxed-template-templ

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

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

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

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

[clang] [clang] Track function template instantiation from definition (PR #112241)

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

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

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

[clang] [clang] Remove the deprecated flag `-frelaxed-template-template-args`. (PR #111894)

2025-01-29 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/111894 >From c15f2faaa2cdc2c6516899c1c0e3c0d90f74f1eb Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Thu, 10 Oct 2024 15:40:48 -0300 Subject: [PATCH] [clang] Remove the deprecated flag `-frelaxed-template-templ

[clang] [clang] Remove the deprecated flag `-frelaxed-template-template-args`. (PR #111894)

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

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

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

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

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

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

2024-12-24 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Thanks! I think I completely missed the fact these were both reverted. https://github.com/llvm/llvm-project/pull/121044 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][AST] Assert that DependentNameType::Name is not null (PR #122418)

2025-01-14 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM, Indeed a DependentNameType with no 'Name' doesn't make sense. https://github.com/llvm/llvm-project/pull/122418 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [clang][AST] Assert that DependentNameType::Name is not null (PR #122418)

2025-01-14 Thread Matheus Izvekov via cfe-commits
@@ -7035,17 +7035,16 @@ class DependentNameType : public TypeWithKeyword, public llvm::FoldingSetNode { : TypeWithKeyword(Keyword, DependentName, CanonType, TypeDependence::DependentInstantiation | toTypeDependence(NNS-

[clang] [clang][AST] Assert that DependentNameType::Name is not null (PR #122418)

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

[clang] [clang] ASTContext: flesh out implementation of getCommonNNS (PR #131964)

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

[clang] [clang] Fix array types comparison in getCommonSugaredType (PR #131649)

2025-03-19 Thread Matheus Izvekov via cfe-commits
@@ -14171,6 +14171,15 @@ static QualType getCommonSugarTypeNode(ASTContext &Ctx, const Type *X, static auto unwrapSugar(SplitQualType &T, Qualifiers &QTotal) { SmallVector R; while (true) { +if (const auto *ATy = dyn_cast(T.Ty)) { + // C++ 9.3.3.4p3: Any type of t

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

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

[clang] [Clang][Sema] Retain the expanding index for unevaluated type constraints (PR #109518)

2025-03-22 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I have a patch, I'll post it soon! https://github.com/llvm/llvm-project/pull/109518 ___ 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 #132234)

2025-03-20 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed https://github.com/llvm/llvm-project/pull/132234 ___ 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] NFC: Clear some uses of MemberPointerType::getClass (PR #132317)

2025-03-20 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/132317 Relands Original PR: https://github.com/llvm/llvm-project/pull/131965 Addresses https://github.com/llvm/llvm-project/pull/131965#issuecomment-2741619498 * Fixes isIncompleteType for injected classes This clear

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

2025-03-21 Thread Matheus Izvekov via cfe-commits
@@ -1072,12 +1072,25 @@ BuildDeductionGuideForTypeAlias(Sema &SemaRef, AliasRhsTemplateArgs, TDeduceInfo, DeduceResults, /*NumberOfArgumentsMustMatch=*/false); + static auto IsNonDeducedArgument = [&](const DeducedTemplateArgument &TA) { +// The following case

[clang] [clang-tools-extra] Reland: [clang] NFC: Clear some uses of MemberPointerType::getClass (PR #132317)

2025-03-21 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I'm going to go ahead and merge it, since this is such a small trivial and obviously correct fix for a relanding. Otherwise, this blocks relanding a much bigger patch, which is a rebase burden. We can always make amendments post commit if anyone feels like it. https://github.c

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

2025-03-20 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Will need to revert a dependent commit, this needs to revert as well so it goes cleanly. https://github.com/llvm/llvm-project/pull/132234 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

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

2025-03-20 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed https://github.com/llvm/llvm-project/pull/132280 ___ 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-03-21 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed 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] Fix various bugs in alias CTAD transform (PR #132061)

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

[clang] d447c6e - [clang] NFC: remove stray newlines from clang/test/Misc/diag-template-diffing-cxx11.cpp

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

[clang] [clang-tools-extra] [clang] Concepts: support pack expansions for type constraints (PR #132626)

2025-03-24 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/132626 >From 6c1a554cfdb7028fccae5f99863c36118fa0226a Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sat, 22 Mar 2025 17:29:16 -0300 Subject: [PATCH 1/3] Revert "[Clang] Distinguish expanding-pack-in-place cases

[clang] [clang] Decay types of function and constant template parameter packs (PR #132189)

2025-03-24 Thread Matheus Izvekov via cfe-commits
@@ -1277,19 +1278,27 @@ QualType Sema::CheckNonTypeTemplateParameterType(TypeSourceInfo *&TSI, TSI = SubstAutoTypeSourceInfoDependent(TSI); } - return CheckNonTypeTemplateParameterType(TSI->getType(), Loc); + return CheckNonTypeTemplateParameterType(TSI->getType(), Lo

[clang] [clang-tools-extra] Revert "[clang] NFC: Clear some uses of MemberPointerType::getClass" (PR #132281)

2025-03-22 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/132281 Reverts llvm/llvm-project#131965 Reverted due to issue reported here: https://github.com/llvm/llvm-project/pull/131965#issuecomment-2741619498 >From 9d96ab9704ba87c81e71d7b26095b68b2ca8aa80 Mon Sep 17 00:00:0

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

2025-03-22 Thread Matheus Izvekov via cfe-commits
@@ -17,3 +16,134 @@ void k() { } } // namespace GH64347 + +namespace GH123591 { + + +template < typename... _Types > +struct variant { + template + variant(_Types...); +}; + +template +using AstNode = variant; + +AstNode tree(42, 43, 44); + +} + +namespace GH123591_2 { + +

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

2025-03-22 Thread Matheus Izvekov via cfe-commits
@@ -17,3 +16,134 @@ void k() { } } // namespace GH64347 + +namespace GH123591 { + + +template < typename... _Types > +struct variant { + template + variant(_Types...); +}; + +template +using AstNode = variant; + +AstNode tree(42, 43, 44); + +} + +namespace GH123591_2 { + +

[clang] [Clang][NFC] Use MarkUsedTemplateParameters in building alias CTAD guides (PR #132369)

2025-03-22 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. Nice cleanup, LGTM https://github.com/llvm/llvm-project/pull/132369 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

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

[clang] [clang] Fix array types comparison in getCommonSugaredType (PR #131649)

2025-03-22 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I posted an alternative fix for this here: https://github.com/llvm/llvm-project/pull/132559 https://github.com/llvm/llvm-project/pull/131649 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[clang] [clang] ASTContex: fix getCommonSugaredType for array types (PR #132559)

2025-03-22 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/132559 >From 27cf231f8497cc483c44d5e5ada05af9ae48e6ab Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Sat, 22 Mar 2025 14:39:10 -0300 Subject: [PATCH] [clang] ASTContex: fix getCommonSugaredType for array types

[clang] [clang] ASTContex: fix getCommonSugaredType for array types (PR #132559)

2025-03-22 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/132559 This corrects the behaviour for getCommonSugaredType with regards to array top level qualifiers: remove differing top level qualifiers, as they must be redundant with element qualifiers. Fixes https://github.

[clang] [clang-tools-extra] [clang] Concepts: support pack expansions for type constraints (PR #132626)

2025-03-24 Thread Matheus Izvekov via cfe-commits
@@ -70,7 +70,14 @@ struct alignas(ConstraintAlignment) AtomicConstraint { // We do not actually substitute the parameter mappings into the // constraint expressions, therefore the constraint expressions are // the originals, and comparing them will suffice. -if

[clang] [clang-tools-extra] [clang] Concepts: support pack expansions for type constraints (PR #132626)

2025-03-24 Thread Matheus Izvekov via cfe-commits
@@ -70,7 +70,14 @@ struct alignas(ConstraintAlignment) AtomicConstraint { // We do not actually substitute the parameter mappings into the // constraint expressions, therefore the constraint expressions are // the originals, and comparing them will suffice. -if

[clang] [clang] Decay types of function and constant template parameter packs (PR #132189)

2025-03-24 Thread Matheus Izvekov via cfe-commits
@@ -1277,19 +1278,27 @@ QualType Sema::CheckNonTypeTemplateParameterType(TypeSourceInfo *&TSI, TSI = SubstAutoTypeSourceInfoDependent(TSI); } - return CheckNonTypeTemplateParameterType(TSI->getType(), Loc); + return CheckNonTypeTemplateParameterType(TSI->getType(), Lo

[clang] [clang-tools-extra] [clang] Concepts: support pack expansions for type constraints (PR #132626)

2025-03-24 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: This is a compile-time improvement overall. The reverted patch adds a 0.07 cost to stage2-clang, which we avoid with the new approach: Commit stage1-O3 stage1-ReleaseThinLTO stage1-ReleaseLTO-g stage1-O0-g stage2-O3 stage2-O0-g stage2-clang [9a089c5fb

[clang] [clang] NFC: Unify implementations of CheckMemberPointerConversion (PR #131966)

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

[clang] [clang] Decay types of function and constant template parameter packs (PR #132189)

2025-03-24 Thread Matheus Izvekov via cfe-commits
@@ -1518,7 +1526,7 @@ NamedDecl *Sema::ActOnNonTypeTemplateParameter(Scope *S, Declarator &D, QualType T = CheckNonTypeTemplateParameterType(TInfo, D.getIdentifierLoc()); if (T.isNull()) { -T = Context.IntTy; // Recover with an 'int' type. +T = TInfo->getType(); -

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

2025-03-24 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Thanks, that would be appreciated. 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][Sema] Improve template argument deduction diagnostic (PR #122754)

2025-03-18 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Yeah, I agree, renaming the other one to what you proposed sounds good to me. https://github.com/llvm/llvm-project/pull/122754 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [clang] Update C++ DR status page (PR #131812)

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

[clang] [clang] Add diagnostic for unresolved using declaration that shadows template parameters (PR #131328)

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

[clang] [clang] Fix array types comparison in getCommonSugaredType (PR #131649)

2025-03-17 Thread Matheus Izvekov via cfe-commits
@@ -14171,6 +14171,15 @@ static QualType getCommonSugarTypeNode(ASTContext &Ctx, const Type *X, static auto unwrapSugar(SplitQualType &T, Qualifiers &QTotal) { SmallVector R; while (true) { +if (const auto *ATy = dyn_cast(T.Ty)) { + // C++ 9.3.3.4p3: Any type of t

[clang] [clang] Fix array types comparison in getCommonSugaredType (PR #131649)

2025-03-17 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov requested changes to this pull request. https://github.com/llvm/llvm-project/pull/131649 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix array types comparison in getCommonSugaredType (PR #131649)

2025-03-17 Thread Matheus Izvekov via cfe-commits
@@ -0,0 +1,10 @@ +// RUN: %clang_cc1 -triple x86_64-linux-gnu %s + +bool a; +constexpr const unsigned char c[] = { 5 }; +constexpr const unsigned char d[1] = { 0 }; +auto b = (a ? d : c); + +constexpr const unsigned char c1[][1] = {{ 5 }}; +constexpr const unsigned char d1[1][1] =

[clang] [clang] Update C++ DR status page (PR #131812)

2025-03-18 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @yuanfang-chen was also involved in implementing this resolution in clang. He is still involved in WG21. https://github.com/llvm/llvm-project/pull/131812 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

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

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

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

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

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

2025-03-20 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Oof, looks like lldb needs updating too. https://github.com/llvm/llvm-project/pull/130537 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RFC][clang] Fix for regression #130917 (PR #132214)

2025-04-04 Thread Matheus Izvekov via cfe-commits
@@ -2572,7 +2572,7 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl( // Friend function defined withing class template may stop being function // definition during AST merges from different modules, in this case decl // with function body should be used for instantiat

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

2025-04-04 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @nico thanks, that's landed. Let me know if it's all green now, otherwise we proceed with the revert. https://github.com/llvm/llvm-project/pull/132401 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[clang] [clang] ASTContex: fix getCommonSugaredType for array types (PR #132559)

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

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

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

[clang] [clang-tools-extra] Revert "[clang] NFC: Clear some uses of MemberPointerType::getClass" (PR #132281)

2025-04-05 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed https://github.com/llvm/llvm-project/pull/132281 ___ 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] NFC: Clear some uses of MemberPointerType::getClass (PR #132317)

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

[clang] [clang] fix structural comparison for dependent class member pointer (PR #133343)

2025-04-05 Thread Matheus Izvekov via cfe-commits
@@ -154,10 +154,30 @@ namespace TestMemberPointerPartialSpec { // DUMP-NEXT: |-TemplateArgument type 'type-parameter-0-0 type-parameter-0-1::*' // DUMP-NEXT: | `-MemberPointerType {{.+}} 'type-parameter-0-0 type-parameter-0-1::*' dependent // DUMP-NEXT: | |-TemplateTypeP

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