[clang] [Clang] Prevent null pointer dereference in Sema::​CodeCompleteQualifiedId() (PR #90490)

2024-04-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Looks good, I will let Tom make the final accept. https://github.com/llvm/llvm-project/pull/90490 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [SemaCXX] Implement CWG2351 `void{}` (PR #78060)

2024-04-29 Thread Shafik Yaghmour via cfe-commits
shafik wrote: @MitalAshok ping https://github.com/llvm/llvm-project/pull/78060 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement CWG2851: floating-point conversions in converted constant expressions (PR #90387)

2024-04-29 Thread Shafik Yaghmour via cfe-commits
@@ -67,6 +68,69 @@ void B::g() requires true; } // namespace cwg2847 +namespace cwg2851 { // cwg2851: 19 + +#if __cplusplus >= 202002L +template struct Val { static constexpr T value = v; }; + + +// Floating-point promotions + +static_assert(Val::value == 0.0L); +static_asser

[clang] [clang] Allow class with anonymous union member to be const-default-constructible even if a union member has a default member initializer (#95854) (PR #96301)

2024-08-26 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I don't think the test failures look related to the changes can you push and empty change to see if rerunning the tests comes up clean? https://github.com/llvm/llvm-project/pull/96301 ___ cfe-commits mailing list c

[clang] [clang][Sema] Fix diagnostic for function overloading in extern "C" (PR #106033)

2024-08-26 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: This make sense to me, @dwblaikie wdyt? https://github.com/llvm/llvm-project/pull/106033 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] prevent assertion failure when converting vectors to int/float with invalid expressions (PR #105727)

2024-08-27 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thank you for the fix, can you add more details to the summary, in this case some details on the fix and why it works would be helpful. https://github.com/llvm/llvm-project/pull/105727 ___ cfe-commits mailing list

[clang] [clang] fix broken canonicalization of DeducedTemplateSpecializationType (PR #95202)

2024-08-27 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Looks like this is linked to a clang-19 regression: https://github.com/llvm/llvm-project/issues/106182 https://github.com/llvm/llvm-project/pull/95202 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[clang] [NFC][Sema] Move `Sema::AssignmentAction` into its own scoped enum (PR #106453)

2024-08-28 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. LGTM except for nitpicks https://github.com/llvm/llvm-project/pull/106453 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][Sema] Move `Sema::AssignmentAction` into its own scoped enum (PR #106453)

2024-08-28 Thread Shafik Yaghmour via cfe-commits
@@ -9491,8 +9496,8 @@ static ExprResult widenIterationCount(unsigned Bits, Expr *E, Sema &SemaRef) { return ExprResult(E); // OK to convert to signed, because new type has more bits than old. QualType NewType = C.getIntTypeForBitwidth(Bits, /*Signed=*/true); - return

[clang] [NFC][Sema] Move `Sema::AssignmentAction` into its own scoped enum (PR #106453)

2024-08-28 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/106453 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][Sema] Move `Sema::AssignmentAction` into its own scoped enum (PR #106453)

2024-08-28 Thread Shafik Yaghmour via cfe-commits
@@ -9469,7 +9473,8 @@ static ExprResult buildCounterUpdate( if (!SemaRef.Context.hasSameType(Update.get()->getType(), VarRef.get()->getType())) { Update = SemaRef.PerformImplicitConversion( - Update.get(), VarRef.get()->ge

[clang] [NFC][Sema] Move `Sema::AssignmentAction` into its own scoped enum (PR #106453)

2024-08-28 Thread Shafik Yaghmour via cfe-commits
@@ -8819,8 +8822,8 @@ Expr *OpenMPIterationSpaceChecker::buildNumIterations( NewSize, Type->hasSignedIntegerRepresentation() || C.getTypeSize(Type) < NewSize); if (!SemaRef.Context.hasSameType(Diff.get()->getType(), NewType)) { -Di

[clang] [clang][bytecode] Add InitLinkScope for temporary variables (PR #106552)

2024-08-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Can you add more details to the summary explaining why the fix is necessary. https://github.com/llvm/llvm-project/pull/106552 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [clang] Fix crash in code with StmtExpr and atomic char load in Expr::EvaluateAsRValue. (PR #106751)

2024-08-30 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: @tbaederr I am not confident this is the right approach. If we compare the non-statement-expression case: https://godbolt.org/z/vseWeh5jP We don't have the same issue as the original case: https://godbolt.org/z/Gh13WcMEz So I suspect there is something abo

[clang] [Clang][Sema] Earlier type checking for builtin unary operators (PR #90500)

2024-07-09 Thread Shafik Yaghmour via cfe-commits
shafik wrote: You reapplied this here: https://github.com/llvm/llvm-project/commit/1595988ee6f9732e7ea79928af8a470ad5ef7dbe but it has caused a regression: https://github.com/llvm/llvm-project/issues/97646 https://github.com/llvm/llvm-project/pull/90500 _

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-07-09 Thread Shafik Yaghmour via cfe-commits
@@ -249,13 +249,15 @@ class APValue { struct NoLValuePath {}; struct UninitArray {}; struct UninitStruct {}; + struct ConstexprUnknown {}; template friend class clang::serialization::BasicReaderBase; friend class ASTImporter; friend class ASTNodeImporter;

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-07-09 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik deleted https://github.com/llvm/llvm-project/pull/95474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-07-09 Thread Shafik Yaghmour via cfe-commits
@@ -249,13 +249,15 @@ class APValue { struct NoLValuePath {}; struct UninitArray {}; struct UninitStruct {}; + struct ConstexprUnknown {}; template friend class clang::serialization::BasicReaderBase; friend class ASTImporter; friend class ASTNodeImporter;

[clang] [Clang] fix cast failures by adjusting the resolution of record declaration contexts to handle semantic and lexical distinctions (PR #96228)

2024-07-12 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/96228 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Don't crash if input file is not a module. (PR #98439)

2024-07-12 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thank you for this fix! https://github.com/llvm/llvm-project/pull/98439 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Don't crash if input file is not a module. (PR #98439)

2024-07-12 Thread Shafik Yaghmour via cfe-commits
shafik wrote: I don't think the build error is related to this change. https://github.com/llvm/llvm-project/pull/98439 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [llvm] Reapply "[Clang] Implement resolution for CWG1835 (#92957)" (PR #98547)

2024-07-12 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > The sad part is that MSVC and some old versions of GCC don't like `template` > being added here :( It looks like the description provides a workaround for gcc but a bug report against MSVC should be filed if we don' have one already. https://github.com/llvm/llvm-project/pull/9

[clang] [clang] Prevent dangling StringRefs (PR #98699)

2024-07-12 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik requested changes to this pull request. It looks like we are using the same pattern that fix is using in `ASTStmtReader::VisitRequiresExpr` which gives me some comfort but I am not happy that we have a relatively complex and easy to get wrong operation repeated in thr

[clang] [clang] Implement P2582R1: CTAD from inherited constructors (PR #98788)

2024-07-13 Thread Shafik Yaghmour via cfe-commits
@@ -2157,17 +2157,19 @@ CXXDeductionGuideDecl *CXXDeductionGuideDecl::Create( ASTContext &C, DeclContext *DC, SourceLocation StartLoc, ExplicitSpecifier ES, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, SourceLocation EndLocation, CXXConstr

[clang] [clang] Implement P2582R1: CTAD from inherited constructors (PR #98788)

2024-07-13 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/98788 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement P2582R1: CTAD from inherited constructors (PR #98788)

2024-07-13 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Quick drive by comment https://github.com/llvm/llvm-project/pull/98788 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement CWG2851: floating-point conversions in converted constant expressions (PR #90387)

2024-04-30 Thread Shafik Yaghmour via cfe-commits
@@ -67,6 +68,69 @@ void B::g() requires true; } // namespace cwg2847 +namespace cwg2851 { // cwg2851: 19 + +#if __cplusplus >= 202002L +template struct Val { static constexpr T value = v; }; + + +// Floating-point promotions + +static_assert(Val::value == 0.0L); +static_asser

[clang] [clang] reject to capture variable in `RequiresExprBodyDecl` (PR #78598)

2024-04-30 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > @cor3ntin @shafik Hi, I want to take charge of this issue and submit a PR for > the fix. I would open a new PR and reference this one in the summary for completeness. It looks like this one is not going to picked up by the author and so if you can take it over and finish it th

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

2024-05-02 Thread Shafik Yaghmour via cfe-commits
@@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++2a -verify -ast-dump -ast-dump-decl-types -ast-dump-filter "deduction guide" %s | FileCheck %s --strict-whitespace +// RUN: %clang_cc1 -std=c++2a -verify -ast-dump -ast-dump-decl-types -Wno-c++11-narrowing -ast-dump-filter "deduction g

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

2024-05-02 Thread Shafik Yaghmour via cfe-commits
@@ -2803,7 +2803,207 @@ getRHSTemplateDeclAndArgs(Sema &SemaRef, TypeAliasTemplateDecl *AliasTemplate) { return {Template, AliasRhsTemplateArgs}; } -// Build deduction guides for a type alias template. +// Build deduction guides for a type alias template from the given unde

[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-02 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/90842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-02 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thank you for this fix. You should reference the issue that this fixes in your summary. This also need a release note. https://github.com/llvm/llvm-project/pull/90842 ___ cfe-commits mailing list cfe-commits@lists

[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-02 Thread Shafik Yaghmour via cfe-commits
@@ -2876,10 +2876,21 @@ class TreeTransform { return ExprError(); Base = BaseResult.get(); + // We want to use `BuildMemberReferenceExpr()` so we can use its logic + // that materializes `Base` into a temporary if it's a prvalue. + // To do so, we

[clang] [Clang][Sema] Fix malformed AST for anonymous class access in template. (PR #90842)

2024-05-02 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Note there is a `BuildAnonymousStructUnionMemberReference`, I am not sure it solves your problem. https://github.com/llvm/llvm-project/pull/90842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [Clang][Sema] Earlier type checking for builtin unary operators (PR #90500)

2024-05-14 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. Thank you for the additional test coverage, LGTM https://github.com/llvm/llvm-project/pull/90500 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [Clang][Sema] ASTContext::getUnconstrainedType propagates dependence (PR #92425)

2024-05-16 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/92425 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] ASTContext::getUnconstrainedType propagates dependence (PR #92425)

2024-05-16 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/92425 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] ASTContext::getUnconstrainedType propagates dependence (PR #92425)

2024-05-16 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,11 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 %s +// expected-no-diagnostics + +template shafik wrote: Nitpick wrap this in `namespace GH77377` since this is a regression test from a bug report https://github.com/llvm/llvm-project/pull/9

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread Shafik Yaghmour via cfe-commits
@@ -167,9 +167,11 @@ Parser::DeclGroupPtrTy Parser::ParseTemplateDeclarationOrSpecialization( LastParamListWasEmpty); // Parse the actual template declaration. - if (Tok.is(tok::kw_concept)) -return Actions.ConvertDeclToDeclGroup( -

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. https://github.com/llvm/llvm-project/pull/92295 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Warn consecutive builtin comparisons in an expression (PR #92200)

2024-05-17 Thread Shafik Yaghmour via cfe-commits
@@ -36,7 +36,7 @@ namespace InExpr { // These are valid expressions. foo(0); +foo(0); // expected-warning {{comparisons like 'X<=Y<=Z' don't have their mathematical meaning}} foo(false); shafik wrote: It is a shame we don't catch this one bu

[clang] [llvm] Disable compiling and testing Flang on Clang changes (PR #92740)

2024-05-20 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: This makes sense given the pain we are seeing here. https://github.com/llvm/llvm-project/pull/92740 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Fix an out-of-bounds crash when diagnosing bad conversion for a function with a parameter pack. (PR #92721)

2024-05-20 Thread Shafik Yaghmour via cfe-commits
@@ -11298,8 +11298,14 @@ static void DiagnoseBadConversion(Sema &S, OverloadCandidate *Cand, Expr *FromExpr = Conv.Bad.FromExpr; QualType FromTy = Conv.Bad.getFromType(); QualType ToTy = Conv.Bad.getToType(); - SourceRange ToParamRange = - !isObjectArgument ? Fn->g

[clang] [Sema] Fix an out-of-bounds crash when diagnosing bad conversion for a function with a parameter pack. (PR #92721)

2024-05-20 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/92721 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Fix an out-of-bounds crash when diagnosing bad conversion for a function with a parameter pack. (PR #92721)

2024-05-20 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Can you add some details to the summary. What was the original code doing wrong and the proposed new approach. https://github.com/llvm/llvm-project/pull/92721 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [C] Disallow declarations where a statement is required (PR #92908)

2024-05-21 Thread Shafik Yaghmour via cfe-commits
@@ -467,15 +467,18 @@ class Parser : public CodeCompletionHandler { /// Flags describing a context in which we're parsing a statement. enum class ParsedStmtContext { +/// This context permits declarations in language modes where declarations +/// are not statements

[clang] [clang] Add tests for CWG issues regarding completeness of types (PR #92113)

2024-05-21 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: LGTM w/ a few nitpicks https://github.com/llvm/llvm-project/pull/92113 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add tests for CWG issues regarding completeness of types (PR #92113)

2024-05-21 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/92113 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add tests for CWG issues regarding completeness of types (PR #92113)

2024-05-21 Thread Shafik Yaghmour via cfe-commits
@@ -451,6 +463,25 @@ static_assert(!__is_nothrow_constructible(D4, int), ""); #endif } // namespace cwg1350 +namespace cwg1352 { // cwg1352: 3.0 +struct A { +#if __cplusplus >= 201103L + int a = sizeof(A); shafik wrote: I think it might be worth it to see th

[clang] [clang] Add tests for CWG issues regarding completeness of types (PR #92113)

2024-05-21 Thread Shafik Yaghmour via cfe-commits
@@ -86,6 +86,23 @@ struct A { }; } +namespace cwg1458 { // cwg1458: 3.1 +#if __cplusplus >= 201103L +struct A; + +void f() { + constexpr A* a = nullptr; + constexpr int p = &*a; + // expected-error@-1 {{cannot initialize a variable of type 'const int' with an rvalue of typ

[clang] [clang] Add tests for CWG issues regarding completeness of types (PR #92113)

2024-05-21 Thread Shafik Yaghmour via cfe-commits
@@ -451,6 +463,25 @@ static_assert(!__is_nothrow_constructible(D4, int), ""); #endif } // namespace cwg1350 +namespace cwg1352 { // cwg1352: 3.0 +struct A { +#if __cplusplus >= 201103L + int a = sizeof(A); shafik wrote: It also mentions in the body of member

[clang] [clang][Sema] Fix crash when diagnosing candidates with parameter packs (PR #93079)

2024-05-22 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. Thank you for the fix. Can you please a little more details to your summary so that folks reading git log have more context. This also needs a release note. Please also add that this also fixes: https://github.com/llvm/llvm-project/issues/

[clang] [clang][Sema] Fix crash when diagnosing candidates with parameter packs (PR #93079)

2024-05-22 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Can you also confirm this fixes: https://github.com/llvm/llvm-project/issues/70191 https://github.com/llvm/llvm-project/pull/93079 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] [Clang] allow `` `@$ `` in raw string delimiters in C++26 (PR #93216)

2024-05-23 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: LGTM but I would like Tom or Aaron to also take a look https://github.com/llvm/llvm-project/pull/93216 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm

[clang] [Clang] prevent assertion failure by avoiding casts on type declarations that require complete types (PR #101426)

2024-07-31 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: This looks good but you need to add a bit more details to your summary, more specifically what case caused the bug to emerge. I am also curious why this does not show up in C++, we obtain a similar diagnostic but no crash. https://github.com/llvm/llvm-pro

[clang] [Clang] prevent assertion failure by avoiding casts on type declarations that require complete types (PR #101426)

2024-07-31 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/101426 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] prevent assertion failure by avoiding casts on type declarations that require complete types (PR #101426)

2024-07-31 Thread Shafik Yaghmour via cfe-commits
@@ -9267,14 +9267,14 @@ bool Sema::RequireLiteralType(SourceLocation Loc, QualType T, if (!RT) return true; - const CXXRecordDecl *RD = cast(RT->getDecl()); - // A partially-defined class type can't be a literal type, because a literal // class type must have a t

[clang] [Clang] prevent assertion failure by avoiding casts on type declarations that require complete types (PR #101426)

2024-07-31 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/101426 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] fix divide by zero in ComplexExprEvaluator (PR #104666)

2024-08-19 Thread Shafik Yaghmour via cfe-commits
shafik wrote: For future reference the summary here is not really sufficient. Since this what usually goes in the git log they should be enough details for folks reading the git log to understand what the change was. The summary should explain the problem and provide a summary of the fix as we

[clang] [C++23] Fix infinite recursion (Clang 19.x regression) (PR #104829)

2024-08-19 Thread Shafik Yaghmour via cfe-commits
@@ -20,3 +19,15 @@ struct S : HasVT { HasD<> v; }; +// Ensure we don't get infinite recursion from the check, however. See GH104802 +namespace GH104802 { +class foo { // expected-note {{definition of 'GH104802::foo' is not complete until the closing '}'}} + foo a;

[clang] [C++23] Fix infinite recursion (Clang 19.x regression) (PR #104829)

2024-08-19 Thread Shafik Yaghmour via cfe-commits
@@ -20,3 +19,29 @@ struct S : HasVT { HasD<> v; }; +// Ensure we don't get infinite recursion from the check, however. See GH104802 +namespace GH104802 { +class foo { // expected-note {{definition of 'GH104802::foo' is not complete until the closing '}'}} + foo a;

[clang] [C++23] Fix infinite recursion (Clang 19.x regression) (PR #104829)

2024-08-19 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. https://github.com/llvm/llvm-project/pull/104829 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Use the correct lookup context when building overloaded 'operator->' in the current instantiation (PR #104458)

2024-08-19 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Can you please add more details in your summary about the problem and how the PR will fix the problem. Having detailed summaries for got log is important. Also for the code reviewer as well, I should get a good snapshot of the problem and fix from the summary. https://github.com

[clang] [NFC] Replace bool <= bool comparison (PR #102948)

2024-08-20 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Can we add more context to the summary i.e. "cppcheck comparisonOfBoolWithBoolError flagged the use of ..." https://github.com/llvm/llvm-project/pull/102948 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [Clang] [Parser] Improve diagnostic for `friend concept` (PR #105121)

2024-08-20 Thread Shafik Yaghmour via cfe-commits
@@ -3139,6 +3139,19 @@ Parser::DeclGroupPtrTy Parser::ParseCXXClassMemberDeclaration( return Actions.BuildDeclaratorGroup(Decls); } + // Befriending a concept is invalid and would already fail if + // we did nothing here, but this allows us to issue a more + // helpf

[clang] Deprecate -fheinous-gnu-extensions; introduce a new warning flag (PR #105821)

2024-08-23 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/105821 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] use parent declaration context to avoid asserting cast failure in defaulted comparison method (PR #96228)

2024-06-21 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/96228 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] use parent declaration context to avoid asserting cast failure in defaulted comparison method (PR #96228)

2024-06-21 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thank you for the fix. I am curious what specifically about this code triggers the crash. We do have a test w/ a defaulted outside the class. So there is another condition needed to trigger this. It looks like removing `constexpr` from `operator==(d h, g i)

[clang] [Clang] use parent declaration context to avoid asserting cast failure in defaulted comparison method (PR #96228)

2024-06-21 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s shafik wrote: I think this is a better location for the test: https://github.com/llvm/llvm-project/blob/main/clang/test/CXX/class/class.compare/class.compare.default/p1.cpp We normally wra

[clang] [Clang] use parent declaration context to avoid asserting cast failure in defaulted comparison method (PR #96228)

2024-06-21 Thread Shafik Yaghmour via cfe-commits
shafik wrote: There are several test failures that look related to this change, please check them out. https://github.com/llvm/llvm-project/pull/96228 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] [clang] Don't emit bogus dangling diagnostics when `[[gsl::Owner]]` and `[[clang::lifetimebound]]` are used together. (PR #108280)

2024-09-11 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Can you add some more details to the summary e.g. "The fix adds an additional check in isGSLOwner() for Owner attribute" or something along those lines. https://github.com/llvm/llvm-project/pull/108280 ___ cfe-comm

[clang] Fix the behavior of __COUNT__ macros when PCH is enabled (PR #105591)

2024-09-12 Thread Shafik Yaghmour via cfe-commits
@@ -1243,12 +1247,19 @@ bool ASTUnit::Parse(std::shared_ptr PCHContainerOps, } std::unique_ptr Act( - new TopLevelDeclTrackerAction(*this)); + new TopLevelDeclTrackerAction(*this, true)); shafik wrote: We should use [bugprone-argument-comment]

[clang] [clang][Sema] Fix assertion in `tryDiagnoseOverloadedCast` (PR #108021)

2024-09-12 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/108021 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Fix assertion in `tryDiagnoseOverloadedCast` (PR #108021)

2024-09-12 Thread Shafik Yaghmour via cfe-commits
@@ -446,7 +446,12 @@ static bool tryDiagnoseOverloadedCast(Sema &S, CastType CT, : InitializationKind::CreateCast(/*type range?*/ range); InitializationSequence sequence(S, entity, initKind, src); - assert(sequence.Failed() && "initialization succeeded on second try?");

[clang] [clang][Sema] Fix assertion in `tryDiagnoseOverloadedCast` (PR #108021)

2024-09-12 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thank you for the fix. Is this from a bug report, if so it should be mentioned in the summary. The summary itself could be a big clearer, maybe a small code example could help. I think this also needs a release note. https://github.com/llvm/llvm-project/p

[clang] Add code completion for C++20 keywords. (PR #107982)

2024-09-12 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: What about `module`, `import` and `export`? https://github.com/llvm/llvm-project/pull/107982 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] handle invalid close location in static assert declaration (PR #108701)

2024-09-14 Thread Shafik Yaghmour via cfe-commits
shafik wrote: So this looks like a regression: https://gcc.godbolt.org/z/h6GexT18E Can we figure out which PR this regression came from and make sure the code change makes sense in light of that PR? Also please add a more detailed summary to this PR, describing why the crash happens and the

[clang] [Clang] handle invalid close location in static assert declaration (PR #108701)

2024-09-14 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik requested changes to this pull request. So this looks like a regression: https://gcc.godbolt.org/z/h6GexT18E Can we figure out which PR this regression came from and make sure the code change makes sense in light of that PR? Also please add a more detailed summary to

[clang] [Clang] handle invalid close location in static assert declaration (PR #108701)

2024-09-14 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > > So this looks like a regression: https://gcc.godbolt.org/z/h6GexT18E > > @shafik https://gcc.godbolt.org/z/Ebvnjrc8e Interesting it crashes in trunk w/o `c++20`: https://gcc.godbolt.org/z/h9xa8eaqo but the backtrace looks the same. We should test this in C++20 and C++23 as w

[clang] [Clang] Do not perform integral promotion if operands of expression `x ? : y` have the same type (PR #108837)

2024-09-16 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,19 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s shafik wrote: I think this test should go in `clang/test/Sema/conditional-expr.c` and we should add a section of the GNU extension there. I am also a bit concerned that we don't have a spe

[clang] [Clang] Reject `this void` explicit object parameters (CWG2915) (PR #108817)

2024-09-16 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > LGTM but it would be nice to do the other changes to cxx_dr_status as a > separate (NFC) commit We should always strive to keep unrelated changes separate. There are a lot of good reasons for this. The most basic is that if we have to revert then we lose both set of changes bu

[clang] [Clang] Allow user defined conversion implicit cast to _Complex types in constant expressions (PR #108758)

2024-09-16 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: You need to add more details to the summary something like: the fix was to handle `CK_UserDefinedConversion` in `ComplexExprEvaluator::VisitCastExpr` as opposed to treating it as an error. https://github.com/llvm/llvm-project/pull/108758 __

[clang] [Clang] prevented assertion failure by handling integral to boolean conversions for boolean vectors (PR #108657)

2024-09-16 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/108657 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] prevented assertion failure by handling integral to boolean conversions for boolean vectors (PR #108657)

2024-09-16 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Please add more details to the summary to explain what the fix actually does. https://github.com/llvm/llvm-project/pull/108657 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] [Clang] prevented assertion failure by handling integral to boolean conversions for boolean vectors (PR #108657)

2024-09-16 Thread Shafik Yaghmour via cfe-commits
@@ -9868,7 +9868,12 @@ static bool tryVectorConvertAndSplat(Sema &S, ExprResult *scalar, // if necessary. CastKind scalarCast = CK_NoOp; - if (vectorEltTy->isIntegralType(S.Context)) { + if (vectorEltTy->isBooleanType()) { +if (scalarTy->isIntegralType(S.Context)) +

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585, #111173)" (PR #111852)

2024-10-14 Thread Shafik Yaghmour via cfe-commits
shafik wrote: It looks like this is linked to this crash: https://github.com/llvm/llvm-project/issues/11 https://github.com/llvm/llvm-project/pull/111852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [clang-tools-extra] [Clang][Sema] Don't set instantiated from function when rewriting operator<=> (PR #91339)

2024-10-08 Thread Shafik Yaghmour via cfe-commits
shafik wrote: This regression: https://github.com/llvm/llvm-project/issues/104720 seems to be linked to this change. https://github.com/llvm/llvm-project/pull/91339 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[clang] [Clang][Parser] Remove the concept from the DeclContext if the definition is invalid (PR #111179)

2024-10-04 Thread Shafik Yaghmour via cfe-commits
@@ -337,6 +343,8 @@ Parser::ParseConceptDefinition(const ParsedTemplateInfo &TemplateInfo, ExprResult ConstraintExprResult = Actions.CorrectDelayedTyposInExpr(ParseConstraintExpression()); if (ConstraintExprResult.isInvalid()) { +if (AddedToScope) ---

[clang] [Clang] prevent assertion failure in value-dependent initializer expressions (PR #112612)

2024-10-18 Thread Shafik Yaghmour via cfe-commits
@@ -11536,6 +11536,9 @@ bool ArrayExprEvaluator::VisitCXXParenListOrInitListExpr( LValue Subobject = This; Subobject.addArray(Info, ExprToVisit, CAT); auto Eval = [&](const Expr *Init, unsigned ArrayIndex) { +if (Init->isValueDependent()) shafik wrot

[clang] [Clang] prevent assertion failure in value-dependent initializer expressions (PR #112612)

2024-10-18 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik requested changes to this pull request. https://github.com/llvm/llvm-project/pull/112612 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix an assertion in expression recovery (PR #112888)

2024-10-18 Thread Shafik Yaghmour via cfe-commits
@@ -1989,7 +1989,7 @@ Expr *CastExpr::getSubExprAsWritten() { SubExpr = IgnoreExprNodes(cast(SubExpr)->getArg(0), ignoreImplicitSemaNodes); } else if (E->getCastKind() == CK_UserDefinedConversion) { - assert((isa(SubExpr) || isa(Su

[clang] [llvm] [AArch64] Add soft-float ABI (PR #84146)

2024-10-21 Thread Shafik Yaghmour via cfe-commits
shafik wrote: This is also linked to this clang-19 regression: https://github.com/llvm/llvm-project/issues/110914 https://github.com/llvm/llvm-project/pull/84146 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [Clang] fix range calculation for conditionals with throw expressions (PR #112081)

2024-10-17 Thread Shafik Yaghmour via cfe-commits
@@ -9827,6 +9827,9 @@ static IntRange GetExprRange(ASTContext &C, const Expr *E, unsigned MaxWidth, return IntRange(BitField->getBitWidthValue(C), BitField->getType()->isUnsignedIntegerOrEnumerationType()); shafik wrote: So why doesn'

[clang] [Clang] fix range calculation for conditionals with throw expressions (PR #112081)

2024-10-17 Thread Shafik Yaghmour via cfe-commits
@@ -9827,6 +9827,9 @@ static IntRange GetExprRange(ASTContext &C, const Expr *E, unsigned MaxWidth, return IntRange(BitField->getBitWidthValue(C), BitField->getType()->isUnsignedIntegerOrEnumerationType()); shafik wrote: What expr is

[clang] [Clang] fix range calculation for conditionals with throw expressions (PR #112081)

2024-10-17 Thread Shafik Yaghmour via cfe-commits
@@ -9827,6 +9827,9 @@ static IntRange GetExprRange(ASTContext &C, const Expr *E, unsigned MaxWidth, return IntRange(BitField->getBitWidthValue(C), BitField->getType()->isUnsignedIntegerOrEnumerationType()); shafik wrote: I think that

[clang] [Clang] fix range calculation for conditionals with throw expressions (PR #112081)

2024-10-17 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: After answering my questions this makes sense to me but I want a second set of eyes. https://github.com/llvm/llvm-project/pull/112081 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [Clang] prevent setting default lexical access specifier for missing primary declarations (PR #112424)

2024-10-17 Thread Shafik Yaghmour via cfe-commits
@@ -39,7 +39,8 @@ bool Sema::SetMemberAccessSpecifier(NamedDecl *MemberDecl, AccessSpecifier LexicalAS) { if (!PrevMemberDecl) { // Use the lexical access specifier. -MemberDecl->setAccess(LexicalAS); shafik wrote:

[clang] [Clang] prevent setting default lexical access specifier for missing primary declarations (PR #112424)

2024-10-17 Thread Shafik Yaghmour via cfe-commits
@@ -39,7 +39,8 @@ bool Sema::SetMemberAccessSpecifier(NamedDecl *MemberDecl, AccessSpecifier LexicalAS) { if (!PrevMemberDecl) { // Use the lexical access specifier. -MemberDecl->setAccess(LexicalAS); shafik wrote:

[clang] [clang-tools-extra] [lldb] [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. (PR #78041)

2024-10-14 Thread Shafik Yaghmour via cfe-commits
shafik wrote: This crash is due to this set of changes: https://github.com/llvm/llvm-project/issues/11 https://github.com/llvm/llvm-project/pull/78041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang] [Clang][Sema] Fix templated array size calculation. (PR #96464)

2024-10-14 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. If you have approvals you don't have to wait for other reviewers unless they have made a comment that required a change and you them to confirm the fix or they explicitly blocked the review. https://github.com/llvm/llvm-project/pull/96464

<    2   3   4   5   6   7   8   9   10   >