[clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-23 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Additionally, just for some namespace sanity (especially from the perspective > of Linux's use of OBTs), can we have the type specifier named > "__ob_$behavior": __ob_wrap, __ob_trap ? That would make things a bit cleaner > for Linux's resulting macros for OBT usage to de-con

[clang] [clang] NFC: add a few template template parameter test cases (PR #160230)

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

[clang] cafc064 - [clang] NFC: small formatting and stray whitespace cleanup

2025-09-21 Thread Matheus Izvekov via cfe-commits
Author: Matheus Izvekov Date: 2025-09-21T20:06:20-03:00 New Revision: cafc064fc7a96b3979a023ddae1da2b499d6c954 URL: https://github.com/llvm/llvm-project/commit/cafc064fc7a96b3979a023ddae1da2b499d6c954 DIFF: https://github.com/llvm/llvm-project/commit/cafc064fc7a96b3979a023ddae1da2b499d6c954.dif

[clang] [clang] WIP: implement ConstantTemplateParamCastExpr (PR #160018)

2025-09-21 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/160018 This fixes a bunch of bugs with how non-type template parameters are transformed and used in template argument deduction. >From a0db4a10c306786d3ab689c4094a2676c18f2c53 Mon Sep 17 00:00:00 2001 From: Matheus I

[clang] [clang] fix using enum redecl in template regression (PR #159996)

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

[clang] [clang-tools-extra] [clang] NFC: change more places to use Type::getAsTagDecl and friends (PR #155313)

2025-09-21 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @bgra8 thanks, this will be fixed here: https://github.com/llvm/llvm-project/pull/159996 https://github.com/llvm/llvm-project/pull/155313 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang] [clang] fix using enum redecl in template regression (PR #159996)

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

[clang] [clang] fix using enum redecl in template regression (PR #159996)

2025-09-21 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/159996 This fixes a regression reported here: https://github.com/llvm/llvm-project/pull/155313#issuecomment-3315883183 Since this regression was never released, there are no release notes. >From ba72adf11519440ceffe

[clang] [clang] ast-dump: use template pattern for `instantiated_from` (PR #159952)

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

[clang] [AST] Assert that FoldingSetNodeID used for hint is correct upon insertion (PR #157692)

2025-09-20 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Sensible? Or presumably we can have an always-inline function wrapper for > that, and the inliner will just take care of it. Yeah, I think the inline helper is cleaner, we can just discard ID before calling anything not inline. https://github.com/llvm/llvm-project/pull/15769

[clang] [clang] remove workaround for SubstNonTypeTemplateParmExpr transform (PR #158541)

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

[clang] [clang] WIP: remove workaround for SubstNonTypeTemplateParmExpr transform (PR #158541)

2025-09-20 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/158541 >From 61ae9330db770dca8f8f9796c741699894154192 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 15 Sep 2025 01:58:01 -0300 Subject: [PATCH] [clang] remove workaround for SubstNonTypeTemplateParmExpr t

[clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-19 Thread Matheus Izvekov via cfe-commits
@@ -339,6 +389,8 @@ ConvertTypeToDiagnosticString(ASTContext &Context, QualType Ty, << "' " << Values << ")"; return DecoratedString; } + +TryConvertOverflowBehaviorTypeToDiagnosticString(Context, Ty, S); mizvekov wrote: If you feel the

[clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-19 Thread Matheus Izvekov via cfe-commits
@@ -339,6 +389,8 @@ ConvertTypeToDiagnosticString(ASTContext &Context, QualType Ty, << "' " << Values << ")"; return DecoratedString; } + +TryConvertOverflowBehaviorTypeToDiagnosticString(Context, Ty, S); mizvekov wrote: > I suppose I e

[clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-19 Thread Matheus Izvekov via cfe-commits
@@ -339,6 +389,8 @@ ConvertTypeToDiagnosticString(ASTContext &Context, QualType Ty, << "' " << Values << ")"; return DecoratedString; } + +TryConvertOverflowBehaviorTypeToDiagnosticString(Context, Ty, S); mizvekov wrote: If you would li

[clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-19 Thread Matheus Izvekov via cfe-commits
@@ -339,6 +389,8 @@ ConvertTypeToDiagnosticString(ASTContext &Context, QualType Ty, << "' " << Values << ")"; return DecoratedString; } + +TryConvertOverflowBehaviorTypeToDiagnosticString(Context, Ty, S); mizvekov wrote: These names sta

[clang] [clang] diagnose invalid std::tuple_size sizes (PR #159677)

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

[clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-19 Thread Matheus Izvekov via cfe-commits
@@ -0,0 +1,7 @@ +// RUN: %clang_cc1 -foverflow-behavior-types -std=c++11 -ast-print %s -o - | FileCheck %s + +extern int __attribute__((overflow_behavior(no_wrap))) a; +extern int __attribute__((overflow_behavior(wrap))) b; + +// CHECK: extern __no_wrap int a; +// CHECK: extern _

[clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-19 Thread Matheus Izvekov via cfe-commits
@@ -0,0 +1,7 @@ +// RUN: %clang_cc1 -foverflow-behavior-types -std=c++11 -ast-print %s -o - | FileCheck %s + +extern int __attribute__((overflow_behavior(no_wrap))) a; +extern int __attribute__((overflow_behavior(wrap))) b; + +// CHECK: extern __no_wrap int a; +// CHECK: extern _

[clang] [clang] diagnose invalid std::tuple_size sizes (PR #159677)

2025-09-19 Thread Matheus Izvekov via cfe-commits
@@ -1222,6 +1222,16 @@ static IsTupleLike isTupleLike(Sema &S, SourceLocation Loc, QualType T, if (E.isInvalid()) return IsTupleLike::Error; + if (Size < 0 || Size >= UINT_MAX) { mizvekov wrote: The host compiler uintmax is the right thing, because we

[clang] [clang] diagnose invalid std::tuple_size sizes (PR #159677)

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

[clang] [clang] diagnose invalid std::tuple_size sizes (PR #159677)

2025-09-19 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/159677 >From 97daa1ef4603eec3c7cf9551db188c000849e907 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Thu, 18 Sep 2025 20:22:40 -0300 Subject: [PATCH] [clang] diagnose invalid std::tuple_size sizes Fixes #159563

[clang] [clang] fix expression classification for dependent binary operators (PR #159819)

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

[clang] [clang] fix expression classification for dependent binary operators (PR #159819)

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

[clang] [clang] diagnose invalid std::tuple_size sizes (PR #159677)

2025-09-19 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/159677 >From 2b8e0e637ee7f1ab4d55b3926f2d694d05d168bb Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Thu, 18 Sep 2025 20:22:40 -0300 Subject: [PATCH] [clang] diagnose invalid std::tuple_size sizes Fixes #159563

[clang] [clang] fix expression classification for dependent binary operators (PR #159819)

2025-09-19 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/159819 This fixes a regression reported here: https://github.com/llvm/llvm-project/pull/159463#issuecomment-3312157416 Since this regression was never released, there are no release notes. >From 21d07e400ab154a298cd

[clang] [libcxx] [Clang] Normalize constraints before checking for satisfaction (PR #141776)

2025-09-18 Thread Matheus Izvekov via cfe-commits
@@ -282,6 +287,11 @@ class TypeConstraint { } }; +/// Insertion operator for diagnostics. This allows sending TemplateName's mizvekov wrote: ```suggestion /// Insertion operator for diagnostics. This allows sending ConceptReferences ``` https://github.co

[clang] [clang] check constant template parameters in dependent contexts (PR #159463)

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

[clang] [clang] check constant template parameters in dependent contexts (PR #159463)

2025-09-18 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Alright, I just thought of a new test case, which my patch doesn't actually change anything. I'll try to get that one covered in another patch. https://github.com/llvm/llvm-project/pull/159463 ___ cfe-commits mailing list cfe-commits@l

[clang] [clang] check constant template parameters in dependent contexts (PR #159463)

2025-09-18 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/159463 >From f0e35786d31bb99f31a625a67c89c211cbe6dac1 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Wed, 17 Sep 2025 18:12:36 -0300 Subject: [PATCH] [clang] check constant template parameters in dependent cont

[clang-tools-extra] [Clangd] [NFC] Fix dereference of null value (PR #159566)

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

[clang-tools-extra] [Clangd] [NFC] Fix dereference of null value (PR #159566)

2025-09-18 Thread Matheus Izvekov via cfe-commits
@@ -145,8 +145,11 @@ std::string getQualification(ASTContext &Context, for (const auto *CurD : llvm::reverse(Parents)) { if (auto *TD = llvm::dyn_cast(CurD)) { QualType T; - if (const auto *RD = dyn_cast(TD); mizvekov wrote: This should be pos

[clang-tools-extra] [Clangd] [NFC] Fix dereference of null value (PR #159566)

2025-09-18 Thread Matheus Izvekov via cfe-commits
@@ -145,8 +145,11 @@ std::string getQualification(ASTContext &Context, for (const auto *CurD : llvm::reverse(Parents)) { if (auto *TD = llvm::dyn_cast(CurD)) { QualType T; - if (const auto *RD = dyn_cast(TD); - ClassTemplateDecl *CTD = RD->getDescribed

[clang] [clang] check constant template parameters in dependent contexts (PR #159463)

2025-09-17 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > I think this makes sense, it seems to do as described at least. I'm not sure > WHAT, but it feels like we could/should do a better job with some > demonstrative tests though. I am open to suggestions, I can't think of anything which would demonstrate this better or show some

[clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-17 Thread Matheus Izvekov via cfe-commits
@@ -0,0 +1,7 @@ +// RUN: %clang_cc1 -foverflow-behavior-types -std=c++11 -ast-print %s -o - | FileCheck %s + +extern int __attribute__((overflow_behavior(no_wrap))) a; +extern int __attribute__((overflow_behavior(wrap))) b; + +// CHECK: extern __no_wrap int a; +// CHECK: extern _

[clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-17 Thread Matheus Izvekov via cfe-commits
@@ -112,6 +112,25 @@ class LangOptionsBase { SOB_Trapping }; + // Used by __attribute__((overflow_behavior())) to describe overflow behavior + // on a per-type basis. + enum OverflowBehaviorKind { +// Default C standard behavior (type dependent). +OB_Unset, +

[clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-17 Thread Matheus Izvekov via cfe-commits
@@ -9002,6 +9057,10 @@ inline bool Type::isIntegralOrEnumerationType() const { if (const auto *ET = dyn_cast(CanonicalType)) return IsEnumDeclComplete(ET->getOriginalDecl()); + if (const OverflowBehaviorType *OBT = + dyn_cast(CanonicalType)) mi

[clang] Add IWYU export pragma to Type.h (PR #159154)

2025-09-16 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. Yeah, that's the intent. Thanks! https://github.com/llvm/llvm-project/pull/159154 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] [clang] remove workaround for SubstNonTypeTemplateParmExpr transform (PR #158541)

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

[clang] [clang] remove workaround for SubstNonTypeTemplateParmExpr transform (PR #158541)

2025-09-16 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: FYI the test change here is not really correct (and so it is not in https://github.com/llvm/llvm-project/pull/141776, where I have taken it from). I have figured out since that calling the semantic action is necessary here, this is just not modeled correctly in clang. https://

[clang] [clang] WIP: remove workaround for SubstNonTypeTemplateParmExpr transform (PR #158541)

2025-09-15 Thread Matheus Izvekov via cfe-commits
@@ -2446,40 +2446,14 @@ TemplateInstantiator::TransformSubstNonTypeTemplateParmExpr( SubstReplacement = TransformExpr(E->getReplacement()); if (SubstReplacement.isInvalid()) return true; - QualType SubstType = TransformType(E->getParameterType(getSema().Context)); -

[clang] [clang] remove workaround for SubstNonTypeTemplateParmExpr transform (PR #158541)

2025-09-15 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/158541 >From 65d24f0b573f2250bf4f99759ecc33f5d6d9ac3a Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 15 Sep 2025 01:58:01 -0300 Subject: [PATCH] [clang] remove workaround for SubstNonTypeTemplateParmExpr t

[clang] [libcxx] [Clang] Normalize constraints before checking for satisfaction (PR #141776)

2025-09-15 Thread Matheus Izvekov via cfe-commits
@@ -9,20 +9,24 @@ concept C2 = C1; // sizeof(U) >= 4 [U = V (decltype(Y{}))] template -constexpr int foo() requires C2 { return 1; } +constexpr int foo() requires C2 { return 1; } // #cand1 // sizeof(U) >= 4 [U = W (decltype(int{}))] template // expected-note@+1{{candidat

[clang] [clang] remove workaround for SubstNonTypeTemplateParmExpr transform (PR #158541)

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

[clang] [clang] remove workaround for SubstNonTypeTemplateParmExpr transform (PR #158541)

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

[clang] [clang] NFC: non-type template argument check cleanup (PR #158515)

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

[clang] [libcxx] [Clang] Normalize constraints before checking for satisfaction (PR #141776)

2025-09-14 Thread Matheus Izvekov via cfe-commits
@@ -1379,216 +1890,327 @@ static void diagnoseWellFormedUnsatisfiedConstraintExpr(Sema &S, S.DiagnoseTypeTraitDetails(SubstExpr); } -template static void diagnoseUnsatisfiedConstraintExpr( -Sema &S, const llvm::PointerUnion &Record, -bool First = true) { - if (a

[clang] [clang] WIP: remove workaround for SubstNonTypeTemplateParmExpr transform (PR #158541)

2025-09-14 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/158541 None >From 297953bedf93135420d86e8289b4a9d59598f4a2 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 15 Sep 2025 01:58:01 -0300 Subject: [PATCH] [clang] WIP: remove workaround for SubstNonTypeTemplat

[clang] [libcxx] [Clang] Normalize constraints before checking for satisfaction (PR #141776)

2025-09-14 Thread Matheus Izvekov via cfe-commits
@@ -1257,4 +1256,35 @@ template concept PerfectSquare = [](){} // expected-note 2{{here}} ([](auto) { return true; }) < PerfectSquare ; // expected-error@-1 {{declaration of 'T' shadows template parameter}} \ // expected-error@-1 {{a concept definition cannot refer to itself}

[clang] [libcxx] [Clang] Normalize constraints before checking for satisfaction (PR #141776)

2025-09-14 Thread Matheus Izvekov via cfe-commits
@@ -1379,216 +1890,327 @@ static void diagnoseWellFormedUnsatisfiedConstraintExpr(Sema &S, S.DiagnoseTypeTraitDetails(SubstExpr); } -template static void diagnoseUnsatisfiedConstraintExpr( -Sema &S, const llvm::PointerUnion &Record, -bool First = true) { - if (a

[clang] [libcxx] [Clang] Normalize constraints before checking for satisfaction (PR #141776)

2025-09-14 Thread Matheus Izvekov via cfe-commits
@@ -1257,4 +1256,35 @@ template concept PerfectSquare = [](){} // expected-note 2{{here}} ([](auto) { return true; }) < PerfectSquare ; // expected-error@-1 {{declaration of 'T' shadows template parameter}} \ // expected-error@-1 {{a concept definition cannot refer to itself}

[clang] [clang] fix partial ordering of NTTP packs (PR #134461)

2025-09-14 Thread Matheus Izvekov via cfe-commits
@@ -7085,18 +7102,24 @@ ExprResult Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param, ? Context.getIntWidth(IntegerType) : Context.getTypeSize(IntegerType)); - SugaredConverted = TemplateArgum

[clang] [clang] NFC: non-type template argument check cleanup (PR #158515)

2025-09-14 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/158515 This is a follow-up to #134461, reverting some unnecessary changes. This cleans up some checks around the assumption that a pack expansion on the argument side could appear when checking non-type template argu

[clang] [clang-tools-extra] [lldb] [clang] AST: remove DependentTemplateSpecializationType (PR #158109)

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

[clang] [clang-tools-extra] [clang] NFC: change more places to use Type::getAsTagDecl and friends (PR #155313)

2025-09-13 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Could this information help you pin-point the issue, or a reproducer is > necessary? @bgra8 Thanks for the heads-up, a reproducer is always helpful, as we can include it in the test suite and make sure it never happens again. Since this involves modules, it probably wouldn'

[clang] [clang] fix incorrect assumption about function type 's ExtInfo (PR #157925)

2025-09-12 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/157925 This fixes an assumption that the ExtInfo for two same function types would have referential equality. This should compare these ExtInfos by value instead. The bug is pre-existing to https://github.com/llvm/l

[clang] [libcxx] [Clang] Normalize constraints before checking for satisfaction (PR #141776)

2025-09-12 Thread Matheus Izvekov via cfe-commits
@@ -16,130 +16,385 @@ #include "clang/AST/ASTContext.h" #include "clang/AST/DeclTemplate.h" #include "clang/AST/Expr.h" +#include "clang/AST/ExprConcepts.h" #include "clang/Basic/SourceLocation.h" +#include "clang/Sema/Ownership.h" #include "llvm/ADT/FoldingSet.h" -#include "

[clang] [libcxx] [Clang] Normalize constraints before checking for satisfaction (PR #141776)

2025-09-12 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: Just a first pass, I'll try to get some time to fully review later. https://github.com/llvm/llvm-project/pull/141776 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang] [libcxx] [Clang] Normalize constraints before checking for satisfaction (PR #141776)

2025-09-12 Thread Matheus Izvekov via cfe-commits
@@ -606,8 +606,11 @@ TemplateArgumentLoc::TemplateArgumentLoc(ASTContext &Ctx, LocInfo(Ctx, TemplateKWLoc, QualifierLoc, TemplateNameLoc, EllipsisLoc) { assert(Argument.getKind() == TemplateArgument::Template || Argument.getKind() == TemplateArgument::TemplateE

[clang] [llvm] [ADT] Add and use (for AArch64) `ValueOrSentinel` (PR #158120)

2025-09-12 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: Can you test this on https://llvm-compile-time-tracker.com to spot any regressions? https://github.com/llvm/llvm-project/pull/158120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [libcxx] [Clang] Normalize constraints before checking for satisfaction (PR #141776)

2025-09-12 Thread Matheus Izvekov via cfe-commits
@@ -16,130 +16,385 @@ #include "clang/AST/ASTContext.h" #include "clang/AST/DeclTemplate.h" #include "clang/AST/Expr.h" +#include "clang/AST/ExprConcepts.h" #include "clang/Basic/SourceLocation.h" +#include "clang/Sema/Ownership.h" #include "llvm/ADT/FoldingSet.h" -#include "

[clang] [llvm] [ADT] Add and use (for AArch64) `ValueOrSentinel` (PR #158120)

2025-09-12 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > I've tweaked `ValueOrSentinel` to allow passing an "adjustment" which allows > it to handle use cases like `UnsignedOrNone`. It seems like UnsignedOrNone is the only use case where we care about what the internal representation looks like. And it seems like the other users a

[clang] [libcxx] [Clang] Normalize constraints before checking for satisfaction (PR #141776)

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

[clang] [clang-tools-extra] [lldb] [clang] AST: remove DependentTemplateSpecializationType (PR #158109)

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

[clang] [clang-tools-extra] [lldb] [clang] AST: remove DependentTemplateSpecializationType (PR #158109)

2025-09-12 Thread Matheus Izvekov via cfe-commits
@@ -222,7 +222,6 @@ RegistryMaps::RegistryMaps() { REGISTER_MATCHER(declRefExpr); REGISTER_MATCHER(dependentNameType); REGISTER_MATCHER(dependentScopeDeclRefExpr); - REGISTER_MATCHER(dependentTemplateSpecializationType); mizvekov wrote: The matcher is h

[clang] [clang-tools-extra] [clang] Improve nested name specifier AST representation (PR #147835)

2025-09-12 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @joanahalili @alexfh that's fixed in https://github.com/llvm/llvm-project/pull/157925 https://github.com/llvm/llvm-project/pull/147835 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] [clang] fix incorrect assumption about function type 's ExtInfo (PR #157925)

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

[clang] [AST] Assert that FoldingSetNodeID used for hint is correct upon insertion (PR #157692)

2025-09-12 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I think having to call a separate thing at every use site is a bit prone to error. Can't we just check this at `InsertNode` instead? https://github.com/llvm/llvm-project/pull/157692 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[clang] [lldb] [clang] remove IsDefaulted bit from TemplateArgument (PR #155120)

2025-09-05 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > I noticed that some tests are dropped in the PR, esp. eg. in the AST > unittests. Did you check the test coverage if that wouldn't shrink due to > those removals? In the ASTImporter I remember a few years ago we added some > tests to exercise the uncovered ctors and getters o

[clang] [clang] fix definition data not being propagated to all redecls (PR #157019)

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

[clang] [lldb] [clang] remove IsDefaulted bit from TemplateArgument (PR #155120)

2025-09-05 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: ping, I need feedback from the DebugInfo experts, do the test changes look good? https://github.com/llvm/llvm-project/pull/155120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [clang] fix definition data not being propagated to all redecls (PR #157019)

2025-09-05 Thread Matheus Izvekov via cfe-commits
@@ -2107,6 +2107,8 @@ void ASTDeclMerger::MergeDefinitionData( auto *Def = DD.Definition; DD = std::move(MergeDD); DD.Definition = Def; +for (auto *TD : Def->redecls()) mizvekov wrote: There's no such a thing as `noload_redecls`, you may be con

[clang] [clang] fix definition data not being propagated to all redecls (PR #157019)

2025-09-04 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/157019 >From c086682815e47b4fb863bb475eb5b02156aa6172 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 1 Sep 2025 17:14:19 -0300 Subject: [PATCH] [clang] fix definition data not being propagated to all redec

[clang] [clang] fix definition data not being propagated to all redecls (PR #157019)

2025-09-04 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/157019 This fixes the workaround added in 8a63989, so that when a fake definition data is corrected, all redeclarations are also updated to point to it. Since this regression was never released, there are no release

[clang] [clang] Remove written template args from implicit var tpl spec (PR #156329)

2025-09-04 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM. I don't love the new bool parameter, but I don't see a simple way to avoid it, and this change is too simple to be worth asking for such a change. https://github.com/llvm/llvm-project/pull/156329

[clang] [clang] Remove written template args from implicit var tpl spec (PR #156329)

2025-09-03 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: I'd suggest wait for the other reviewers, or until next week if no response. https://github.com/llvm/llvm-project/pull/156329 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang] [clang] Remove written template args from implicit var tpl spec (PR #156329)

2025-09-02 Thread Matheus Izvekov via cfe-commits
@@ -11662,7 +11662,8 @@ class Sema final : public SemaBase { DeclResult CheckVarTemplateId(VarTemplateDecl *Template, SourceLocation TemplateLoc, SourceLocation TemplateNameLoc, -c

[clang] [clang] Remove written template args from implicit var tpl spec (PR #156329)

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

[clang] [clang] Remove written template args from implicit var tpl spec (PR #156329)

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

[clang] [clang] Remove written template args from implicit var tpl spec (PR #156329)

2025-09-02 Thread Matheus Izvekov via cfe-commits
@@ -11662,7 +11662,8 @@ class Sema final : public SemaBase { DeclResult CheckVarTemplateId(VarTemplateDecl *Template, SourceLocation TemplateLoc, SourceLocation TemplateNameLoc, -c

[clang] [clang] Remove written template args from implicit var tpl spec (PR #156329)

2025-09-02 Thread Matheus Izvekov via cfe-commits
@@ -11662,7 +11662,8 @@ class Sema final : public SemaBase { DeclResult CheckVarTemplateId(VarTemplateDecl *Template, SourceLocation TemplateLoc, SourceLocation TemplateNameLoc, -c

[clang] [clang] Remove written template args from implicit var tpl spec (PR #156329)

2025-09-02 Thread Matheus Izvekov via cfe-commits
@@ -11662,7 +11662,8 @@ class Sema final : public SemaBase { DeclResult CheckVarTemplateId(VarTemplateDecl *Template, SourceLocation TemplateLoc, SourceLocation TemplateNameLoc, -c

[clang] [clang-tools-extra] [clang][AST] Fix source range of class template implicit instantiations. (PR #156011)

2025-09-01 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > OK, I understand. Could you point me to where that pattern selection happens? > I will not be able to work on that PR for two weeks but I can go back on it > afterward. In `Sema::InstantiateClass`, which is implemented in SemaTemplateInstantiate.cpp. https://github.com/llvm

[clang] [clang-tools-extra] [clang][AST] Fix source range of class template implicit instantiations. (PR #156011)

2025-09-01 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: The problem is not whether the template instantiation is a definition or not, if the type is required to be complete, then it needs to be a definition. If it's not required to be complete, then it doesn't need to be. What happens here is that when the instantiation is needed, b

[clang] Using type deduction to define __SIZE_TYPE__ and __PTRDIFF_TYPE__ (PR #155979)

2025-08-30 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > @mizvekov The ast-dump test I added passes locally, but the CI is failing to > match the string. How do I resolve this? I would guess that kind of problem is due to line ending differences. But in any case, I was thinking more about doing text-mode ast-dump tests. If you wan

[clang] [clang] fix obtaining EnumDecl for UsingEnumDecl (PR #156127)

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

[clang] [clang] fix obtaining EnumDecl for UsingEnumDecl (PR #156127)

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

[clang] [clang] fix obtaining EnumDecl for UsingEnumDecl (PR #156127)

2025-08-29 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/156127 Use the castAs acessor for the type for a UsingEnumDecl, as it can be sugar for an EnumType. Fixes a regression reported here: https://github.com/llvm/llvm-project/pull/155313#issuecomment-3238482327 Since t

[clang] [clang-tools-extra] [clang][AST] Fix source range of class template implicit instantiations. (PR #156011)

2025-08-29 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > The most important part for me, is that if > `TagDecl::isThisDeclarationADefinition()` returns true, then I need > `getSourceRange()` to return the content of the definition. That's a more interesting limited part of the problem. It seems strange to me that we produce a temp

[clang] [clang][AST] Fix source range of class template implicit instantiations. (PR #156011)

2025-08-29 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Thanks for the feedback @mizvekov. I propose this change for the following > reasons: > > * Class template implicit instantiations have technically no source range > anywhere, which is why I think having the same behavior as function template > implicit instantiations or var

[clang] Using type deduction to define __SIZE_TYPE__ and __PTRDIFF_TYPE__ (PR #155979)

2025-08-29 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > Which file is appropriate to add it to? Or should I create a new file? For common-type concerns, you can add it to `Sema/sugar-common-types.c` for C code, or `clang/test/SemaCXX/sugar-common-types.cpp` for C++. For AST dumps, I don't see a great fit anywhere, so if you create

[clang] Using type deduction to define __SIZE_TYPE__ and __PTRDIFF_TYPE__ (PR #155979)

2025-08-29 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: You could include your opening snippet as a test case within the patch. Or even a simple AST dump test case showing these types contain __size_t et al as bottom-level sugar. https://github.com/llvm/llvm-project/pull/155979 ___ cfe-com

[clang] [clang][AST] Fix source range of class template implicit instantiations. (PR #156011)

2025-08-29 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: Why is this the correct behavior, rather than the other way around? The patch seems to leave no way to query the source range of this declaration, rather than the definition. On the other hand, querying the source range of the definition is currently pos

[clang] [clang-tools-extra] [lldb] [clang] NFC: rename clang/include/clang/AST/Type.h to TypeBase.h (PR #155049)

2025-08-28 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > If they are including `Type.h` in files that only exist downstream that will > force them to deal with this both times around, unless I am missing something. No, they would only have had to do that if they had rebased in between this commit landing and the next one, but that

[clang] [clang] fix nested tags of the same name not being included in their … (PR #155965)

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

[clang] [clang] fix nested tags of the same name not being included in their context (PR #155965)

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

[clang] [clang] fix nested tags of the same name not being included in their context (PR #155965)

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

[clang] [clang] fix nested tags of the same name not being included in their context (PR #155965)

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

[clang] [clang] fix nested tags of the same name not being included in their … (PR #155965)

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

[clang] [clang] fix nested tags of the same name not being included in their … (PR #155965)

2025-08-28 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/155965 …context Fix an error in the logic meant to handle a redeclaration such as: ```C++ struct A { struct __attribute__((foo)) A *ptr; }; ``` In the declaration of ptr, we must introduce a new redeclaration of A i

  1   2   3   4   5   6   7   8   9   10   >