[clang] [clang][sema] Remove unused local SourceLocation (PR #151455)

2025-07-31 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin approved this pull request. https://github.com/llvm/llvm-project/pull/151455 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Switch sanity check to assert; NFC (PR #151181)

2025-07-29 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin approved this pull request. https://github.com/llvm/llvm-project/pull/151181 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C23] Handle type compatibility for enumerations better (PR #150282)

2025-07-29 Thread Corentin Jabot via cfe-commits
@@ -870,7 +870,29 @@ static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, else if (T1->getTypeClass() == Type::FunctionNoProto && T2->getTypeClass() == Type::FunctionProto) TC = Type::FunctionNoProto; -else +else if (Contex

[clang] [lldb] [Clang] Initial support for P2841 (Variable template and concept template parameters) (PR #150823)

2025-07-29 Thread Corentin Jabot via cfe-commits
@@ -1746,6 +1754,16 @@ class TemplateTemplateParmDecl final return SourceRange(getTemplateParameters()->getTemplateLoc(), End); } + TemplateNameKind kind() const { cor3ntin wrote: Oh, I somehow completely misread your point. I will think about it. No

[clang] [NFC] [Sema] [Modules] Use DynamicRecursiveASTVisitor to reduce generted code size (PR #151074)

2025-07-29 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/151074 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [Clang] Initial support for P2841 (Variable template and concept template parameters) (PR #150823)

2025-07-29 Thread Corentin Jabot via cfe-commits
@@ -1162,12 +1179,32 @@ static ExprResult formImmediatelyDeclaredConstraint( // constraint of T. [...] CXXScopeSpec SS; SS.Adopt(NS); - ExprResult ImmediatelyDeclaredConstraint = S.CheckConceptTemplateId( - SS, /*TemplateKWLoc=*/SourceLocation(), NameInfo, -

[clang] [lldb] [Clang] Initial support for P2841 (Variable template and concept template parameters) (PR #150823)

2025-07-29 Thread Corentin Jabot via cfe-commits
@@ -4694,6 +4759,28 @@ ExprResult Sema::CheckVarTemplateId( return BuildDeclarationNameExpr(SS, NameInfo, Var, FoundD, TemplateArgs); } +ExprResult Sema::CheckVarOrConceptTemplateTemplateId( +const CXXScopeSpec &, const DeclarationNameInfo &, +TemplateTemplateParmDec

[clang] [lldb] [Clang] Initial support for P2841 (Variable template and concept template parameters) (PR #150823)

2025-07-29 Thread Corentin Jabot via cfe-commits
@@ -26,115 +27,116 @@ #include namespace clang { - /// Represents the parsed form of a C++ template argument. - class ParsedTemplateArgument { - public: -/// Describes the kind of template argument that was parsed. -enum KindType { - /// A template type parame

[clang] [lldb] [Clang] Initial support for P2841 (Variable template and concept template parameters) (PR #150823)

2025-07-29 Thread Corentin Jabot via cfe-commits
@@ -2187,6 +2189,27 @@ TemplateName TemplateInstantiator::TransformTemplateName( AllowInjectedClassName); } +TemplateArgument TemplateInstantiator::TransformNamedTemplateTemplateArgument( +CXXScopeSpec &SS, TemplateName Name, Sourc

[clang] [lldb] [Clang] Initial support for P2841 (Variable template and concept template parameters) (PR #150823)

2025-07-29 Thread Corentin Jabot via cfe-commits
@@ -2187,6 +2189,27 @@ TemplateName TemplateInstantiator::TransformTemplateName( AllowInjectedClassName); } +TemplateArgument TemplateInstantiator::TransformNamedTemplateTemplateArgument( +CXXScopeSpec &SS, TemplateName Name, Sourc

[clang] [lldb] [Clang] Initial support for P2841 (Variable template and concept template parameters) (PR #150823)

2025-07-29 Thread Corentin Jabot via cfe-commits
@@ -9034,11 +9225,11 @@ void Sema::CheckConceptRedefinition(ConceptDecl *NewDecl, Context.setPrimaryMergedDecl(NewDecl, OldConcept->getCanonicalDecl()); } -bool Sema::CheckConceptUseInDefinition(ConceptDecl *Concept, - SourceLocation Lo

[clang] [lldb] [Clang] Initial support for P2841 (Variable template and concept template parameters) (PR #150823)

2025-07-29 Thread Corentin Jabot via cfe-commits
@@ -4694,6 +4759,28 @@ ExprResult Sema::CheckVarTemplateId( return BuildDeclarationNameExpr(SS, NameInfo, Var, FoundD, TemplateArgs); } +ExprResult Sema::CheckVarOrConceptTemplateTemplateId( +const CXXScopeSpec &, const DeclarationNameInfo &, +TemplateTemplateParmDec

[clang] [lldb] [Clang] Initial support for P2841 (Variable template and concept template parameters) (PR #150823)

2025-07-29 Thread Corentin Jabot via cfe-commits
@@ -5144,6 +5163,56 @@ bool TreeTransform::TransformTemplateArguments( } +template +template +bool TreeTransform::TransformConceptTemplateArguments( +InputIterator First, InputIterator Last, TemplateArgumentListInfo &Outputs, +bool Uneval) { cor3nti

[clang] [lldb] [Clang] Initial support for P2841 (Variable template and concept template parameters) (PR #150823)

2025-07-29 Thread Corentin Jabot via cfe-commits
@@ -235,7 +237,7 @@ void TemplateParameterList::getAssociatedConstraints( ACs.emplace_back(E); } } - if (HasRequiresClause) + if (HasRequiresClause && getRequiresClause()) cor3ntin wrote: This is not needed! https://github.com/llvm/llvm-

[clang] [lldb] [Clang] Initial support for P2841 (Variable template and concept template parameters) (PR #150823)

2025-07-29 Thread Corentin Jabot via cfe-commits
@@ -5144,6 +5163,56 @@ bool TreeTransform::TransformTemplateArguments( } +template +template +bool TreeTransform::TransformConceptTemplateArguments( +InputIterator First, InputIterator Last, TemplateArgumentListInfo &Outputs, +bool Uneval) { + + auto isConcept = []

[clang] [lldb] [Clang] Initial support for P2841 (Variable template and concept template parameters) (PR #150823)

2025-07-29 Thread Corentin Jabot via cfe-commits
@@ -339,6 +339,18 @@ bool TemplateArgument::isPackExpansion() const { llvm_unreachable("Invalid TemplateArgument Kind!"); } +bool TemplateArgument::isConceptOrConceptTemplateParameter() const { + bool isConcept = false; + if (getKind() == TemplateArgument::Template) { +

[clang] [lldb] [Clang] Initial support for P2841 (Variable template and concept template parameters) (PR #150823)

2025-07-29 Thread Corentin Jabot via cfe-commits
@@ -1746,6 +1754,16 @@ class TemplateTemplateParmDecl final return SourceRange(getTemplateParameters()->getTemplateLoc(), End); } + TemplateNameKind kind() const { cor3ntin wrote: `TemplateNameKind` is pre-existing. It's the kind of a `TemplateName`. N

[clang] [Basic] Remove getVirtualFile (PR #151086)

2025-07-28 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin approved this pull request. https://github.com/llvm/llvm-project/pull/151086 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [Clang] Initial support for P2841 (Variable template and concept template parameters) (PR #150823)

2025-07-28 Thread Corentin Jabot via cfe-commits
cor3ntin wrote: > I don't quite get what is happening here yet, can you give a summary of what > is being accomplished, and how you're doing so? Let me try to see if I can enlighten you a bit. P2841 very simply extends the notion of template template parameters to variable templates and conce

[clang] [lldb] [Clang] Initial support for P2841 (Variable template and concept template parameters) (PR #150823)

2025-07-28 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/150823 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] Variable template and concept template parameters (PR #150823)

2025-07-28 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin ready_for_review https://github.com/llvm/llvm-project/pull/150823 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] Variable template and concept template parameters (PR #150823)

2025-07-28 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/150823 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] Variable template and concept template parameters (PR #150823)

2025-07-28 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/150823 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement instantiation context note for checking template parameters (PR #126088)

2025-07-28 Thread Corentin Jabot via cfe-commits
cor3ntin wrote: @mizvekov are you still working on that? Thanks https://github.com/llvm/llvm-project/pull/126088 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix a regression introduced by #147046 (PR #150893)

2025-07-28 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/150893 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix a regression introduced by #147046 (PR #150893)

2025-07-28 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/150893 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix a regression introduced by #147046 (PR #150893)

2025-07-28 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/150893 >From 8af7ce05012ca6e0047fc452196befc056eadf40 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Mon, 28 Jul 2025 09:20:28 +0200 Subject: [PATCH] [Clang] Fix a regression introduced by #147046 Static functio

[clang] [Clang] Fix a regression introduced by #147046 (PR #150893)

2025-07-28 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin created https://github.com/llvm/llvm-project/pull/150893 We should not skip the first argument of static member functions when initalizing a conversion sequence for a non-deducible parameter. >From a8fb90c5f2c87dff630259117ee2fd6d435b709d Mon Sep 17 00:00:00 2001 Fr

[clang] [Clang][RFC] Do not eat SFINAE diagnostics for explicit template arguments (PR #139066)

2025-07-24 Thread Corentin Jabot via cfe-commits
@@ -12166,6 +12174,15 @@ static void DiagnoseBadDeduction(Sema &S, NamedDecl *Found, Decl *Templated, diag::note_ovl_candidate_explicit_arg_mismatch_unnamed) << (index + 1); } + +if (PartialDiagnosticAt *PDiag = DeductionFailure.getSFINAEDiagnost

[clang] [Clang] suppress deprecated field warnings in implicit special-member functions (PR #147400)

2025-07-23 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/147400 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix a crash on invalid concept (PR #150186)

2025-07-23 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/150186 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix a crash on invalid concept (PR #150186)

2025-07-23 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin created https://github.com/llvm/llvm-project/pull/150186 Fixes #149986 >From 44e0a15203f0d579c6c78ddf135a4f76e164b642 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Wed, 23 Jul 2025 10:31:49 +0200 Subject: [PATCH] [Clang] Fix a crash on invalid concept Fixes #

[clang] [Clang][RFC] Do not eat SFINAE diagnostics for explicit template arguments (PR #139066)

2025-07-23 Thread Corentin Jabot via cfe-commits
@@ -12166,6 +12174,15 @@ static void DiagnoseBadDeduction(Sema &S, NamedDecl *Found, Decl *Templated, diag::note_ovl_candidate_explicit_arg_mismatch_unnamed) << (index + 1); } + +if (PartialDiagnosticAt *PDiag = DeductionFailure.getSFINAEDiagnost

[clang] [Clang] suppress deprecated field warnings in implicit special-member functions (PR #147400)

2025-07-23 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/147400 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] suppress deprecated field warnings in implicit special-member functions (PR #147400)

2025-07-23 Thread Corentin Jabot via cfe-commits
@@ -983,6 +983,7 @@ Bug Fixes to C++ Support non-empty initializer list. (#GH147949) - Fixed constant evaluation of equality comparisons of constexpr-unknown references. (#GH147663) - Diagnose binding a reference to ``*nullptr`` during constant evaluation. (#GH48665) +- Sup

[clang] [Clang] suppress deprecated field warnings in implicit special-member functions (PR #147400)

2025-07-23 Thread Corentin Jabot via cfe-commits
@@ -547,6 +547,12 @@ static void DoEmitAvailabilityWarning(Sema &S, AvailabilityResult K, return; } case AR_Deprecated: +// Suppress -Wdeprecated-declarations in purely implicit special-member cor3ntin wrote: ```suggestion // Suppress -Wdeprec

[clang] [Clang] suppress deprecated field warnings in implicit special-member functions (PR #147400)

2025-07-23 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/147400 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Preprocessor] Do not expand macros if the input is already preprocessed (PR #137665)

2025-07-23 Thread Corentin Jabot via cfe-commits
Juan Manuel Martinez =?utf-8?q?Caama=C3=B1o?= , Juan Manuel Martinez =?utf-8?q?Caama=C3=B1o?= Message-ID: In-Reply-To: @@ -98,7 +100,11 @@ class FrontendAction { /// /// This is guaranteed to only be called following a successful call to /// BeginSourceFileAction (and

[clang] [Preprocessor] Do not expand macros if the input is already preprocessed (PR #137665)

2025-07-23 Thread Corentin Jabot via cfe-commits
Juan Manuel Martinez =?utf-8?q?Caama=C3=B1o?= , Juan Manuel Martinez =?utf-8?q?Caama=C3=B1o?= Message-ID: In-Reply-To: https://github.com/cor3ntin approved this pull request. LGTM. Please wait ~20h in case @AaronBallman @erichkeane have further comments https://github.com/llvm/llvm-project/pu

[clang] [clang][bytecode] Only implicitly start lifetime of trivially-default-constructible union members (PR #149835)

2025-07-21 Thread Corentin Jabot via cfe-commits
@@ -25,11 +25,18 @@ using APSInt = llvm::APSInt; namespace clang { namespace interp { +static bool hasTrivialDefaultCtorParent(const FieldDecl *FD) { + assert(FD); + assert(FD->getParent()->isUnion()); + const auto *CXXRD = dyn_cast(FD->getParent()); + return !CXXRD || CXX

[clang] [Clang] Fix a partial ordering bug involving CTAD injected template arguments (PR #149782)

2025-07-21 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin approved this pull request. https://github.com/llvm/llvm-project/pull/149782 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Be less strict about diagnosing null pointer dereference. (PR #149648)

2025-07-19 Thread Corentin Jabot via cfe-commits
cor3ntin wrote: /cherry-pick c43f828 https://github.com/llvm/llvm-project/pull/149648 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Be less strict about diagnosing null pointer dereference. (PR #149648)

2025-07-19 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin milestoned https://github.com/llvm/llvm-project/pull/149648 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Be less strict about diagnosing null pointer dereference. (PR #149648)

2025-07-19 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/149648 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Be less strict about diagnosing null pointer dereference. (PR #149648)

2025-07-19 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/149648 >From 5cbf868adba8682cc20e4647085ce6361d61455e Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Sat, 19 Jul 2025 12:38:20 +0200 Subject: [PATCH 1/2] [Clang] Be less strict about diagnosing null pointer dere

[clang] [Clang] Be less strict about diagnosing null pointer dereference. (PR #149648)

2025-07-19 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin created https://github.com/llvm/llvm-project/pull/149648 In #143667, we made constant evaluation fail on `*null_ptr`, as this is UB. However, `&(*(foo*)0)` seems to be a common pattern, which made #143667 too disruptive. So instead of failing the evaluation, we not

[clang] More fixes for P3144R2 implementation (PR #149406)

2025-07-18 Thread Corentin Jabot via cfe-commits
@@ -8392,17 +8392,19 @@ def ext_default_init_const : ExtWarn< "is a Microsoft extension">, InGroup; def err_delete_operand : Error<"cannot delete expression of type %0">; +def err_delete_void_ptr_operand : Error< + "cannot delete expression with pointer-to-'void' type %0">

[clang] More fixes for P3144R2 implementation (PR #149406)

2025-07-18 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/149406 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] More fixes for P3144R2 implementation (PR #149406)

2025-07-18 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin commented: This change needs a release note. Please add an entry to `clang/docs/ReleaseNotes.rst` in the section the most adapted to the change, and referencing any Github issue this change fixes. Thanks! https://github.com/llvm/llvm-project/pull/149406

[clang] More fixes for P3144R2 implementation (PR #149406)

2025-07-18 Thread Corentin Jabot via cfe-commits
@@ -8392,17 +8392,19 @@ def ext_default_init_const : ExtWarn< "is a Microsoft extension">, InGroup; def err_delete_operand : Error<"cannot delete expression of type %0">; +def err_delete_void_ptr_operand : Error< + "cannot delete expression with pointer-to-'void' type %0">

[clang] More fixes for P3144R2 implementation (PR #149406)

2025-07-18 Thread Corentin Jabot via cfe-commits
@@ -8392,17 +8392,19 @@ def ext_default_init_const : ExtWarn< "is a Microsoft extension">, InGroup; def err_delete_operand : Error<"cannot delete expression of type %0">; +def err_delete_void_ptr_operand : Error< + "cannot delete expression with pointer-to-'void' type %0">

[clang] More fixes for P3144R2 implementation (PR #149406)

2025-07-18 Thread Corentin Jabot via cfe-commits
@@ -8392,17 +8392,19 @@ def ext_default_init_const : ExtWarn< "is a Microsoft extension">, InGroup; def err_delete_operand : Error<"cannot delete expression of type %0">; +def err_delete_void_ptr_operand : Error< + "cannot delete expression with pointer-to-'void' type %0">

[clang] More fixes for P3144R2 implementation (PR #149406)

2025-07-18 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/149406 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Do not assume a perfect match is a better match than a non-template non-perfect match (PR #149504)

2025-07-18 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/149504 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Use bytecode interpreter in isPotentialConstantExprU… (PR #149462)

2025-07-18 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin approved this pull request. https://github.com/llvm/llvm-project/pull/149462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Do not assume a perfect match is a better match than a non-template non-perfect match (PR #149504)

2025-07-18 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/149504 >From f34d340f59e742f6e75397043b0bed8faed7d94a Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Fri, 18 Jul 2025 10:27:44 +0200 Subject: [PATCH 1/2] [Clang] Do not assume a perfect match is a better match t

[clang] [Clang] Do not assume a perfect match is a better match than a non-template non-perfect match (PR #149504)

2025-07-18 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin created https://github.com/llvm/llvm-project/pull/149504 This fixes a regression introduced by the "perfect match" overload resolution mechanism introduced in 8c5a307. [This does regress the performance noticeably (-0.7% for a stage 2 build)](https://llvm-compile-t

[clang] [Clang] suppress deprecated field warnings in implicit special-member functions (PR #147400)

2025-07-18 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin requested changes to this pull request. There is still unaddressed feedback https://github.com/llvm/llvm-project/pull/147400 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang] [Clang] suppress deprecated field warnings in implicit special-member functions (PR #147400)

2025-07-18 Thread Corentin Jabot via cfe-commits
@@ -547,6 +547,15 @@ static void DoEmitAvailabilityWarning(Sema &S, AvailabilityResult K, return; } case AR_Deprecated: +// Suppress -Wdeprecated-declarations in purely implicit special-member functions. +if (auto *MD = dyn_cast_if_present(S.getCurFunctionDecl

[clang] [clang] Fix potential constant expression checking with constexpr-unknown. (PR #149227)

2025-07-17 Thread Corentin Jabot via cfe-commits
@@ -24,3 +24,8 @@ constexpr void other_func() { throw 12; } + +// Make sure these don't trigger the diagnostic. +extern const bool& b; +constexpr bool fun1() { return b; } +constexpr bool fun2(const bool& b) { return b; } cor3ntin wrote: Can you reference t

[clang] [clang] Fix potential constant expression checking with constexpr-unknown. (PR #149227)

2025-07-17 Thread Corentin Jabot via cfe-commits
@@ -357,3 +357,27 @@ namespace pointer_comparisons { static_assert(!f4()); // expected-error {{static assertion expression is not an integral constant expression}} \ // expected-note {{in call to 'f4()'}} } + +namespace enable_if_1 { + template <__SI

[clang] [clang] Fix potential constant expression checking with constexpr-unknown. (PR #149227)

2025-07-17 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/149227 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix potential constant expression checking with constexpr-unknown. (PR #149227)

2025-07-17 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin approved this pull request. LGTM (presumably, we want to backport that) https://github.com/llvm/llvm-project/pull/149227 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[clang] [Clang] Ensure correct parameters are in the scope for constraint equivalence checking (PR #149264)

2025-07-17 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/149264 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Diagnose dereferencing a null pointer (PR #149330)

2025-07-17 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin approved this pull request. LGTM, thanks. (Note that this does not cover the case of forming a reference to a one-past-the-end object, which is covered by the same wording, but if you don't already do that, it can be a separate pr. https://github.com/llvm/llvm-proje

[clang] Revert "[Clang] Do not treat Foo -> const Foo conversion sequences as perfect" (PR #149272)

2025-07-17 Thread Corentin Jabot via cfe-commits
cor3ntin wrote: /cherry-pick 28e1e7e https://github.com/llvm/llvm-project/pull/149272 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[Clang] Do not treat Foo -> const Foo conversion sequences as perfect" (PR #149272)

2025-07-17 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin milestoned https://github.com/llvm/llvm-project/pull/149272 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Improve clarity of the implicit declaration diagnostic (PR #149314)

2025-07-17 Thread Corentin Jabot via cfe-commits
@@ -816,11 +816,12 @@ def warn_unreachable_association : Warning< /// Built-in functions. def ext_implicit_lib_function_decl : ExtWarn< - "implicitly declaring library function '%0' with type %1">, - InGroup; + "implicitly declaring library function '%0' with%select{| stan

[clang] Improve clarity of the implicit declaration diagnostic (PR #149314)

2025-07-17 Thread Corentin Jabot via cfe-commits
@@ -716,6 +716,10 @@ Improvements to Clang's diagnostics Added a new warning in this group for the case where the attribute is missing/implicit on an override of a virtual method. + - Reworded the ``-Wimplicit-function-declaration`` diagnostic to make it more + clear th

[clang] Improve clarity of the implicit declaration diagnostic (PR #149314)

2025-07-17 Thread Corentin Jabot via cfe-commits
@@ -376,6 +376,33 @@ class Context { return getInfo(ID).Header.getName(); } + /// Returns true if a library function is declared within a C or C++ standard + /// header (like stdio.h) or POSIX header (like malloc.h), false if the + /// function is not declared within

[clang] [Clang] Do not treat Foo -> const Foo conversion sequences as perfect (PR #148613)

2025-07-17 Thread Corentin Jabot via cfe-commits
cor3ntin wrote: Sorry for the inconvenience. It was clearly not the right solution in hindsight. It may take me a while to figure out how to approach a fix to https://github.com/llvm/llvm-project/issues/147374 https://github.com/llvm/llvm-project/pull/148613 ___

[clang] Revert "[Clang] Do not treat Foo -> const Foo conversion sequences as perfect" (PR #149272)

2025-07-17 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/149272 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[Clang] Do not treat Foo -> const Foo conversion sequences as perfect" (PR #149272)

2025-07-17 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin created https://github.com/llvm/llvm-project/pull/149272 Reverts llvm/llvm-project#148613 Considering object argument conversion qualifications perfect leads to situations where we prefer a non-template const qualified function over a non-qualified template functio

[clang] [Clang] Do not treat Foo -> const Foo conversion sequences as perfect (PR #148613)

2025-07-16 Thread Corentin Jabot via cfe-commits
cor3ntin wrote: Thanks for the heads up! I'm looking into it. Reduced to ```cpp struct TmsException { int _what; const char* what() const; template int& what() & { return _what; } }; int main() { TmsException E; E.what() = 42; }``` https://github.com/llvm/llvm-project/pull/148613

[clang] [Clang] Fix export declaration diagnostic message (PR #149059)

2025-07-16 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/149059 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [Clang] Diagnose forming references to nullptr (PR #143667)

2025-07-16 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/143667 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix export declaration diagnostic message (PR #149059)

2025-07-16 Thread Corentin Jabot via cfe-commits
cor3ntin wrote: Thanks! I'll merge this later today, unless @Bigcheese has opinions https://github.com/llvm/llvm-project/pull/149059 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix export declaration diagnostic message (PR #149059)

2025-07-16 Thread Corentin Jabot via cfe-commits
cor3ntin wrote: > Should I submit another PR to convert the spaces in these two places? > @cor3ntin No, please add a commit to your branch (and push), it will update this PR! Thanks https://github.com/llvm/llvm-project/pull/149059 ___ cfe-commits ma

[clang] [Clang] Fix export declaration diagnostic message (PR #149059)

2025-07-16 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin approved this pull request. LGTM modulo whitespaces changes. Thanks for the fix https://github.com/llvm/llvm-project/pull/149059 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[clang] [Clang] Fix export declaration diagnostic message (PR #149059)

2025-07-16 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/149059 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix export declaration diagnostic message (PR #149059)

2025-07-16 Thread Corentin Jabot via cfe-commits
@@ -10642,7 +10642,7 @@ def warn_dangling_reference_captured_by_unknown : Warning< "the full-expression">, InGroup; def warn_experimental_lifetime_safety_dummy_warning : Warning< - "todo: remove this warning after we have atleast one warning based on the lifetime analys

[clang] [Clang] Fix export declaration diagnostic message (PR #149059)

2025-07-16 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin approved this pull request. LGTM modulo the whitespace-only changes https://github.com/llvm/llvm-project/pull/149059 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[clang] [Clang] Fix export declaration diagnostic message (PR #149059)

2025-07-16 Thread Corentin Jabot via cfe-commits
@@ -12540,7 +12540,7 @@ def warn_zero_as_null_pointer_constant : Warning< InGroup>, DefaultIgnore; def warn_not_eliding_copy_on_return : Warning< - "not eliding copy on return">, + "not eliding copy on return">, cor3ntin wrote: Can you revert this whites

[clang] [Clang] Fix export declaration diagnostic message (PR #149059)

2025-07-16 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/149059 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [Clang] Diagnose forming references to nullptr (PR #143667)

2025-07-16 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/143667 >From a3f85983a8ab50de52c1e4825f490120e8ecdac2 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Wed, 2 Jul 2025 15:55:41 +0200 Subject: [PATCH 1/7] Diagnose all dereferences of null pointers --- clang/docs

[clang] [libcxx] [Clang] Diagnose forming references to nullptr (PR #143667)

2025-07-16 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/143667 >From a3f85983a8ab50de52c1e4825f490120e8ecdac2 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Wed, 2 Jul 2025 15:55:41 +0200 Subject: [PATCH 1/7] Diagnose all dereferences of null pointers --- clang/docs

[clang] [libcxx] [Clang] Diagnose forming references to nullptr (PR #143667)

2025-07-16 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/143667 >From a3f85983a8ab50de52c1e4825f490120e8ecdac2 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Wed, 2 Jul 2025 15:55:41 +0200 Subject: [PATCH 1/7] Diagnose all dereferences of null pointers --- clang/docs

[clang] Check if clang::FieldDecl has constant-integer bit width before getting the width (PR #148692)

2025-07-15 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin approved this pull request. https://github.com/llvm/llvm-project/pull/148692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++] Fix a failed assertion with nullability checking (PR #148881)

2025-07-15 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin approved this pull request. https://github.com/llvm/llvm-project/pull/148881 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix a crash when parsing an invalid `decltype` (PR #148798)

2025-07-15 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/148798 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [Clang] Diagnose forming references to nullptr (PR #143667)

2025-07-15 Thread Corentin Jabot via cfe-commits
cor3ntin wrote: @AaronBallman @philnik777 you have more feedback? https://github.com/llvm/llvm-project/pull/143667 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix a crash when parsing an invalid `decltype` (PR #148798)

2025-07-15 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/148798 >From c80347a825264474a51ee6e638434d3454a0a7e3 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Tue, 15 Jul 2025 09:38:59 +0200 Subject: [PATCH 1/2] [Clang] Fix a crash when parsing an invalid `decltype` We

[clang] [Clang] Remove explicit object from non member function. (PR #148807)

2025-07-15 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/148807 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Remove explicit object from non member function. (PR #148807)

2025-07-15 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/148807 >From 25d5589b47b39779958c94011814cb68fd7ea374 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Tue, 15 Jul 2025 11:06:03 +0200 Subject: [PATCH] [Clang] Remove explicit object from non member function. To a

[clang] [Clang] Remove explicit object from non member function. (PR #148807)

2025-07-15 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin created https://github.com/llvm/llvm-project/pull/148807 To avoid crashing later (as we assume only member functions can have explicit parameters) Fixes #113185 >From bf204f023a4f84732c5876ff86e7de603fd95aac Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Tue,

[clang] [Clang] Do not treat Foo -> const Foo conversion sequences as perfect (PR #148613)

2025-07-15 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/148613 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Reduce the size of ParsedAttributesView and AttributePool (PR #148726)

2025-07-15 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin approved this pull request. https://github.com/llvm/llvm-project/pull/148726 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Reduce the small vector size for DeclTypeInfo. (PR #148788)

2025-07-15 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin approved this pull request. https://github.com/llvm/llvm-project/pull/148788 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Check if clang::FieldDecl has constant-integer bit width before getting the width (PR #148692)

2025-07-15 Thread Corentin Jabot via cfe-commits
cor3ntin wrote: Can you add tests (and a release note) Thanks! https://github.com/llvm/llvm-project/pull/148692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix an issue where we erroneously diagnose a `[[noreturn]]` function with `warn_suggest_noreturn_function` (PR #148695)

2025-07-15 Thread Corentin Jabot via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/148695 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   4   5   6   >