[clang] [Clang] Remove unneeded template keyword (PR #71435)

2023-11-06 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik closed https://github.com/llvm/llvm-project/pull/71435 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[Clang] Remove unneeded template keyword" (PR #71478)

2023-11-06 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik created https://github.com/llvm/llvm-project/pull/71478 Reverts llvm/llvm-project#71435 This is failing on some build bots e.g.: https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/62315/consoleFull#-3939952849ba4694-19c4-4d7e-bec5-911270d8a58c >From

[clang] [Clang] Remove unneeded template keyword (PR #71435)

2023-11-06 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Sadly this is failing on some build bots: https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/62315/consoleFull#-3939952849ba4694-19c4-4d7e-bec5-911270d8a58c Not sure why at the moment. Will revert for now. https://github.com/llvm/llvm-project/pull/71435

[clang] Revert "[Clang] Remove unneeded template keyword" (PR #71478)

2023-11-06 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik closed https://github.com/llvm/llvm-project/pull/71478 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix clang++ crash on assertions when compiling source (PR #70594)

2023-10-30 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,19 @@ +// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify +// RUN: %clang_cc1 -fsyntax-only -std=c++23 %s -verify + +// expected-no-diagnostics + +struct A {}; +using CA = const A; + +struct S1 : CA { shafik wrote: These examples:

[clang] [clang] Fix clang++ crash on assertions when compiling source (PR #70594)

2023-10-30 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,19 @@ +// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify shafik wrote: Normally if we add a new test just for a specific bug report we name it something like `GH35603.cpp` so we can readily identify the test is linked to github issue 35603. If

[clang] [clang] Fix clang++ crash on assertions when compiling source (PR #70594)

2023-10-30 Thread Shafik Yaghmour via cfe-commits
@@ -6431,7 +6431,7 @@ static bool HandleConstructorCall(const Expr *E, const LValue , // Non-virtual base classes are initialized in the order in the class // definition. We have already checked for virtual base classes. assert(!BaseIt->isVirtual() &&

[clang] [Clang] Ensure zero-init is not overridden when initializing a base class in a constant expression context (PR #70150)

2023-10-24 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik created https://github.com/llvm/llvm-project/pull/70150 During constant evaluation when value-initializing a class if the base class was default-initialized it would undue the previously zero-initialized class members. This fixes the way we handle default

[clang] [Clang] Ensure zero-init is not overridden when initializing a base class in a constant expression context (PR #70150)

2023-10-24 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/70150 >From 1e7ec004102349a67519966bb7111838668ab2b4 Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Tue, 24 Oct 2023 16:21:30 -0700 Subject: [PATCH] [Clang] Ensure zero-init is not overridden when intializing a

[clang] [Clang] Remove unneeded template keyword (PR #71435)

2023-11-06 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik created https://github.com/llvm/llvm-project/pull/71435 As noted in this bug report: https://github.com/llvm/llvm-project/issues/37647 Due to this clang bug we added the template keyword in Redeclarable.h. The bug has been fixed since then, so removing it. >From

[clang] [Sema] Fixed faulty shift count warning (PR #69521)

2023-10-30 Thread Shafik Yaghmour via cfe-commits
@@ -12143,8 +12143,7 @@ static void DiagnoseBadShiftValues(Sema& S, ExprResult , ExprResult , auto FXSema = S.Context.getFixedPointSemantics(LHSExprType); LeftSize = FXSema.getWidth() - (unsigned)FXSema.hasUnsignedPadding(); } - llvm::APInt

[clang] Implement [[msvc::no_unique_address]] (PR #65675)

2023-09-19 Thread Shafik Yaghmour via cfe-commits
@@ -3317,6 +3353,7 @@ ASTContext::getASTRecordLayout(const RecordDecl *D) const { Builder.EndsWithZeroSizedObject, Builder.LeadsWithZeroSizedBase, Builder.Bases, Builder.VBases); } else { + MicrosoftRecordLayoutBuilder Builder(*this,

[clang] Implement [[msvc::no_unique_address]] (PR #65675)

2023-09-19 Thread Shafik Yaghmour via cfe-commits
@@ -3317,6 +3353,7 @@ ASTContext::getASTRecordLayout(const RecordDecl *D) const { Builder.EndsWithZeroSizedObject, Builder.LeadsWithZeroSizedBase, Builder.Bases, Builder.VBases); } else { + MicrosoftRecordLayoutBuilder Builder(*this,

[clang] [clang][Interp] Handle CXXScalarValueInitExprs (PR #67147)

2023-09-22 Thread Shafik Yaghmour via cfe-commits
@@ -31,6 +31,13 @@ static_assert(b, ""); constexpr int one = true; static_assert(one == 1, ""); +constexpr bool b2 = bool(); shafik wrote: There are a lot of scalars: https://eel.is/c++draft/basic.types.general#9 Can we have a test for each case?

[clang] [clang][Interp] Handle CXXScalarValueInitExprs (PR #67147)

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

[clang] [clang][Interp] Handle CXXScalarValueInitExprs (PR #67147)

2023-09-22 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Looks good but I want more tests. https://github.com/llvm/llvm-project/pull/67147 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Turn -Wenum-constexpr-conversion into a hard error (PR #67170)

2023-09-22 Thread Shafik Yaghmour via cfe-commits
shafik wrote: This change is a lot more involved, this is on my list of things to do. See the discussion here: https://reviews.llvm.org/D150226 https://github.com/llvm/llvm-project/pull/67170 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][Interp] Handle CXXScalarValueInitExprs (PR #67147)

2023-09-23 Thread Shafik Yaghmour via cfe-commits
Timm =?utf-8?q?B=C3=A4der?= Message-ID: In-Reply-To: @@ -31,6 +31,28 @@ static_assert(b, ""); constexpr int one = true; static_assert(one == 1, ""); +constexpr bool b2 = bool(); +static_assert(!b2, ""); + +namespace ScalarTypes { + constexpr int ScalarInitInt = int(); +

[clang] [clang][Interp] Handle CXXScalarValueInitExprs (PR #67147)

2023-09-23 Thread Shafik Yaghmour via cfe-commits
Timm =?utf-8?q?B=C3=A4der?= Message-ID: In-Reply-To: https://github.com/shafik commented: Thank you for the additions, almost there :-) https://github.com/llvm/llvm-project/pull/67147 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][Interp] Handle CXXScalarValueInitExprs (PR #67147)

2023-09-23 Thread Shafik Yaghmour via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/67147 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [Clang] Fix crash when visting a fold expression in a default argument (PR #67514)

2023-09-28 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/67514 >From e2e0e10e13748ba9369b73c7547c035ee75dfffa Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Tue, 26 Sep 2023 18:55:44 -0700 Subject: [PATCH] [Clang] Fix crash when visting a fold expression in a default

[clang-tools-extra] [Clang] Fix crash when visting a fold expression in a default argument (PR #67514)

2023-09-28 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/67514 >From e2e0e10e13748ba9369b73c7547c035ee75dfffa Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Tue, 26 Sep 2023 18:55:44 -0700 Subject: [PATCH] [Clang] Fix crash when visting a fold expression in a default

[clang] [clang][Interp] Zero-init remaining string literal elements (PR #66862)

2023-09-28 Thread Shafik Yaghmour via cfe-commits
@@ -858,8 +858,8 @@ bool ByteCodeExprGen::VisitStringLiteral(const StringLiteral *E) { // If the initializer string is too long, a diagnostic has already been // emitted. Read only the array length from the string literal. - unsigned N = -

[clang] [clang][Interp] Zero-init remaining string literal elements (PR #66862)

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

[clang] [clang][Interp] Zero-init remaining string literal elements (PR #66862)

2023-09-28 Thread Shafik Yaghmour via cfe-commits
@@ -350,3 +350,22 @@ namespace ZeroInit { static_assert(b.f[0] == 0.0, ""); static_assert(b.f[1] == 0.0, ""); } + +namespace StringZeroFill { + struct A { +char c[12]; + }; + constexpr A a = { "abc" }; + static_assert(a.c[0] == 'a', ""); + static_assert(a.c[1] ==

[clang] [clang][Interp] Zero-init remaining string literal elements (PR #66862)

2023-09-28 Thread Shafik Yaghmour via cfe-commits
@@ -350,3 +350,22 @@ namespace ZeroInit { static_assert(b.f[0] == 0.0, ""); static_assert(b.f[1] == 0.0, ""); } + +namespace StringZeroFill { + struct A { +char c[12]; + }; + constexpr A a = { "abc" }; + static_assert(a.c[0] == 'a', ""); + static_assert(a.c[1] ==

[clang] [clang][Interp] Zero-init remaining string literal elements (PR #66862)

2023-09-28 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Minor comments on testing but I am curious about the size question. https://github.com/llvm/llvm-project/pull/66862 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Fix a crash from nested ArrayInitLoopExpr (PR #67722)

2023-09-28 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Thank you for the fix! I don't think I understand the bug based on your description. You say >the reason is that after evaluating the first iteration, we note a failure and >would return, however during analyzing the second snippet You start saying *first iteration* and then

[libunwind] [Clang] Fix crash when visting a fold expression in a default argument (PR #67514)

2023-09-28 Thread Shafik Yaghmour via cfe-commits
shafik wrote: I am going to merge this because I was informed that libc++ build is triggered unnecessarily because I merged main into my branch. https://github.com/llvm/llvm-project/pull/67514 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [Clang] Fix crash when visting a fold expression in a default argument (PR #67514)

2023-09-28 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik closed https://github.com/llvm/llvm-project/pull/67514 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] implement common sugared type of inst-dependent DecltypeType (PR #67739)

2023-09-28 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. Thank you for the quick fix. LGTM, please add a release note. https://github.com/llvm/llvm-project/pull/67739 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-25 Thread Shafik Yaghmour via cfe-commits
@@ -2352,26 +2352,61 @@ static void handleUnusedAttr(Sema , Decl *D, const ParsedAttr ) { D->addAttr(::new (S.Context) UnusedAttr(S.Context, AL)); } -static void handleConstructorAttr(Sema , Decl *D, const ParsedAttr ) { - uint32_t priority =

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-25 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Should they be valid for `constexpr` functions? https://github.com/llvm/llvm-project/pull/67360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

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

[clang] [Clang] Fix CXXRewrittenBinaryOperator::getDecomposedForm to handle case when spaceship operator returns comparison category by reference (PR #66270)

2023-09-25 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/66270 >From b934841d7fc3d3447b23a9718a38742943f76916 Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Wed, 13 Sep 2023 11:09:28 -0700 Subject: [PATCH 1/2] [Clang] Fix CXXRewrittenBinaryOperator::getDecomposedForm

[clang-tools-extra] [Clang] Fix CXXRewrittenBinaryOperator::getDecomposedForm to handle case when spaceship operator returns comparison category by reference (PR #66270)

2023-09-25 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/66270 >From b934841d7fc3d3447b23a9718a38742943f76916 Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Wed, 13 Sep 2023 11:09:28 -0700 Subject: [PATCH 1/2] [Clang] Fix CXXRewrittenBinaryOperator::getDecomposedForm

[clang] [Clang] Fix crash when ill-formed code is treated as a deduction guide (PR #67373)

2023-09-25 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik created https://github.com/llvm/llvm-project/pull/67373 In some cases where ill-formed code could be interpreted as a deduction guide we can crash because we reach an unreachable path. This fixes this issue by introducing a diagnostic instead. Fixes:

[clang] [Clang] Fix crash when ill-formed code is treated as a deduction guide (PR #67373)

2023-09-25 Thread Shafik Yaghmour via cfe-commits
shafik wrote: I was originally going to roll-up this fix as part of: https://reviews.llvm.org/D148474 but it felt distinct enough to fix on its own and then rebase the other PR afterwards. https://github.com/llvm/llvm-project/pull/67373 ___

[clang] [Clang] Fix crash when ill-formed code is treated as a deduction guide (PR #67373)

2023-09-25 Thread Shafik Yaghmour via cfe-commits
@@ -171,3 +171,12 @@ namespace CtorTemplateBeatsNonTemplateConversionFn { Foo f(Derived d) { return d; } // expected-error {{invokes a deleted function}} Foo g(Derived d) { return Foo(d); } // ok, calls constructor } + +namespace GH65522 { +template +class B3 : A3 { +

[clang] [Clang] Fix CXXRewrittenBinaryOperator::getDecomposedForm to handle case when spaceship operator returns comparison category by reference (PR #66270)

2023-09-25 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/66270 >From b934841d7fc3d3447b23a9718a38742943f76916 Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Wed, 13 Sep 2023 11:09:28 -0700 Subject: [PATCH 1/3] [Clang] Fix CXXRewrittenBinaryOperator::getDecomposedForm

[clang] [Clang] Fix CXXRewrittenBinaryOperator::getDecomposedForm to handle case when spaceship operator returns comparison category by reference (PR #66270)

2023-09-25 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik closed https://github.com/llvm/llvm-project/pull/66270 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix crash when ill-formed code is treated as a deduction guide (PR #67373)

2023-09-26 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/67373 >From beab5db738483795ecb0bace2842acdbb1c9869a Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Mon, 25 Sep 2023 13:56:43 -0700 Subject: [PATCH] [Clang] Fix crash when ill-formed code is treated as a

[clang] [Clang] Fix crash when ill-formed code is treated as a deduction guide (PR #67373)

2023-09-26 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik resolved https://github.com/llvm/llvm-project/pull/67373 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix crash when ill-formed code is treated as a deduction guide (PR #67373)

2023-09-26 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik resolved https://github.com/llvm/llvm-project/pull/67373 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix crash when ill-formed code is treated as a deduction guide (PR #67373)

2023-09-30 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/67373 >From beab5db738483795ecb0bace2842acdbb1c9869a Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Mon, 25 Sep 2023 13:56:43 -0700 Subject: [PATCH 1/2] [Clang] Fix crash when ill-formed code is treated as a

[clang] [clang] Bump latest release to 17 for C++ DR Status page (PR #67996)

2023-10-02 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Thank you for this work. https://github.com/llvm/llvm-project/pull/67996 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [libc++] Implement ranges::contains_subrange (PR #66963)

2023-10-02 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Please make sure you add a description to your PR. This is what usually goes into the git log and we want those entries to be as descriptive and helpful for folks who read the git logs, thank you. https://github.com/llvm/llvm-project/pull/66963

[clang] [libc++] Implement ranges::contains_subrange (PR #66963)

2023-10-02 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Please make sure you add a description to your PR. This is what usually goes into the git log and we want those entries to be as descriptive and helpful for folks who read the git logs, thank you. https://github.com/llvm/llvm-project/pull/66963

[clang] [clang] Add test for CWG472 (PR #67948)

2023-10-02 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: None of the implementations seem to agree with the resolution of the DR: https://godbolt.org/z/a7nEvW5Gr https://github.com/llvm/llvm-project/pull/67948 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Add test for CWG1341 (PR #67965)

2023-10-02 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Thank you for the tests. https://github.com/llvm/llvm-project/pull/67965 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Bugfix for chosing the correct deduction guide (PR #66487)

2023-10-02 Thread Shafik Yaghmour via cfe-commits
shafik wrote: I added a comment in the issue her: https://github.com/llvm/llvm-project/issues/67959#issuecomment-1743564143 Please make sure to add references to the standard in appropriate places in this PR. https://github.com/llvm/llvm-project/pull/66487

[clang] Mark an ObjCIvarDecl as invalid if its type contains errors (PR #68001)

2023-10-02 Thread Shafik Yaghmour via cfe-commits
shafik wrote: The PR description could have used more details. Was this fixing a crash bug, a conformance issue, lack of diagnostic etc What is the new behavior would also be helpful. Was there a bug report linked to this fix? Is so that should be linked in the description. If we are fixing

[clang] [NFC][Clang][CodeGen] Improve performance for vtable metadata generation (PR #67066)

2023-10-02 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Please next time before you commit add a more detailed description of the change so that readers of git log can get a better understanding of the change w/o having to view it in detail. https://github.com/llvm/llvm-project/pull/67066

[clang] [clang][ExprConst] Fix crash on uninitialized array subobject (PR #67817)

2023-10-01 Thread Shafik Yaghmour via cfe-commits
@@ -2411,10 +2411,15 @@ static bool CheckEvaluationResult(CheckEvaluationResultKind CERK, const FieldDecl *SubobjectDecl, CheckedTemporaries ) { if (!Value.hasValue()) { -assert(SubobjectDecl &&

[clang] [clang][ExprConst] Fix crash on uninitialized array subobject (PR #67817)

2023-10-01 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/67817 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ExprConst] Fix crash on uninitialized array subobject (PR #67817)

2023-10-01 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I am a bit concerned we don't fully understand how to recover the old diagnostic. I left a comment that I think may help but I think we need to understand this a bit better before committing to a fix. https://github.com/llvm/llvm-project/pull/67817

[clang] [Support] Add KnownBits::computeForSubBorrow (PR #67788)

2023-10-01 Thread Shafik Yaghmour via cfe-commits
@@ -85,6 +85,18 @@ KnownBits KnownBits::computeForAddSub(bool Add, bool NSW, return KnownOut; } +KnownBits KnownBits::computeForSubBorrow(const KnownBits , KnownBits RHS, + const KnownBits ) { + assert(Borrow.getBitWidth() == 1 &&

[clang-tools-extra] [Support] Add KnownBits::computeForSubBorrow (PR #67788)

2023-10-01 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/67788 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __datasizeof (PR #67805)

2023-10-01 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/67805 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __datasizeof (PR #67805)

2023-10-01 Thread Shafik Yaghmour via cfe-commits
@@ -5038,19 +5039,19 @@ void CXXNameMangler::mangleExpression(const Expr *E, unsigned Arity, Out << 'a'; MangleAlignofSizeofArg(); break; +case UETT_DataSizeOf: { + Context.getDiags().Report(diag::err_cannot_mangle_expression) + <<

[clang] [Clang] Add __datasizeof (PR #67805)

2023-10-01 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Looks good but Aaron should look at it as well. https://github.com/llvm/llvm-project/pull/67805 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __datasizeof (PR #67805)

2023-10-01 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,34 @@ +// RUN: %clang_cc1 -fsyntax-only -triple x86_64-linux-gnu -verify %s shafik wrote: Maybe we should add tests to show parallels with `sizeof` e.g` *void* types and incomplete types. Also w/o parens etc

[clang] [NFC][clang] change remaining context-dependent type nodes to ContextualFoldingSet (PR #67751)

2023-10-01 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Thank you for the PR. Could you provide some context in the PR description? From the title it sounds like there were prior changes that this is finishing. It would be helpful to have a link to those prior changes. https://github.com/llvm/llvm-project/pull/67751

[clang-tools-extra] [libcxx] Allow string to use SSO in constant evaluation. (PR #66576)

2023-09-26 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I think this is fine but I agree we should have a compat warning for this and I would like to see more testing as well. https://github.com/llvm/llvm-project/pull/66576 ___ cfe-commits mailing list

[clang] [libcxx] Allow string to use SSO in constant evaluation. (PR #66576)

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

[clang-tools-extra] [libcxx] Allow string to use SSO in constant evaluation. (PR #66576)

2023-09-26 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,22 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [libcxx] Allow string to use SSO in constant evaluation. (PR #66576)

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

[clang] [Clang] Fix crash when visting a fold expression in a default argument (PR #67514)

2023-09-26 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik created https://github.com/llvm/llvm-project/pull/67514 CheckDefaultArgumentVisitor::Visit(...) assumes that the children of Expr will not be NULL. This is not a valid assumption and when we have a CXXFoldExpr the children can be NULL and this causes a crash. Fixes:

[clang] [Clang] Handle consteval expression in array bounds expressions (PR #66222)

2023-09-27 Thread Shafik Yaghmour via cfe-commits
@@ -15090,8 +15093,9 @@ static void CheckImplicitConversion(Sema , Expr *E, QualType T, if (SourceBT && TargetBT && SourceBT->isIntegerType() && TargetBT->isFloatingType() && !IsListInit) { // Determine the number of precision bits in the source integer type. -

[clang] [Clang] Handle consteval expression in array bounds expressions (PR #66222)

2023-09-27 Thread Shafik Yaghmour via cfe-commits
@@ -5490,6 +5490,9 @@ TreeTransform::TransformDependentSizedArrayType(TypeLocBuilder , EnterExpressionEvaluationContext Unevaluated( SemaRef, Sema::ExpressionEvaluationContext::ConstantEvaluated); + // VLA bounds are not truly constant. shafik

[clang] [Clang] Handle sema of noexcept condition in their evaluation context. (PR #67538)

2023-09-27 Thread Shafik Yaghmour via cfe-commits
shafik wrote: I wonder does this also fix this: https://github.com/llvm/llvm-project/issues/67058 https://github.com/llvm/llvm-project/pull/67538 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang] Fix crash when visting a fold expression in a default argument (PR #67514)

2023-09-27 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/67514 >From e2e0e10e13748ba9369b73c7547c035ee75dfffa Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Tue, 26 Sep 2023 18:55:44 -0700 Subject: [PATCH] [Clang] Fix crash when visting a fold expression in a default

[clang] Bugfix for chosing the correct deduction guide (PR #66487)

2023-10-03 Thread Shafik Yaghmour via cfe-commits
@@ -85,3 +85,13 @@ int main() { } + +namespace deduceTemplatedConstructor{ shafik wrote: I apologize for asking you to do additional work here but can you add the rest of the examples from [over.match.best.general

[clang] Bugfix for chosing the correct deduction guide (PR #66487)

2023-10-03 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. Thank you for the follow-up work. LGTM https://github.com/llvm/llvm-project/pull/66487 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang] Fix constant evaluating a captured variable in a lambda (PR #68090)

2023-10-03 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Can you write a more detailed description explaining what the problem is what the fix is. This is what usually ends up in the git log and we want that to be as descriptive as possible for folks who use it to understand changes quickly without digging into details.

[clang] [Clang] Fix constant evaluating a captured variable in a lambda (PR #68090)

2023-10-03 Thread Shafik Yaghmour via cfe-commits
@@ -8367,7 +8367,13 @@ bool LValueExprEvaluator::VisitVarDecl(const Expr *E, const VarDecl *VD) { if (auto *FD = Info.CurrentCall->LambdaCaptureFields.lookup(VD)) { // Start with 'Result' referring to the complete closure object... - Result =

[clang] Fixes and closes #53952. Setting the ASTHasCompilerErrors member variable correctly based on the PP diagnostics. (PR #68127)

2023-10-03 Thread Shafik Yaghmour via cfe-commits
@@ -4628,6 +4628,12 @@ ASTFileSignature ASTWriter::WriteAST(Sema , StringRef OutputFile, WritingAST = true; ASTHasCompilerErrors = hasErrors; + bool trueHasErrors = SemaRef.PP.getDiagnostics().hasUncompilableErrorOccurred(); shafik wrote: So this

[clang] Fixes and closes #53952. Setting the ASTHasCompilerErrors member variable correctly based on the PP diagnostics. (PR #68127)

2023-10-03 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: The fix does not look correct but perhaps someone else will have more insight. https://github.com/llvm/llvm-project/pull/68127 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] Fixes and closes #53952. Setting the ASTHasCompilerErrors member variable correctly based on the PP diagnostics. (PR #68127)

2023-10-03 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/68127 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix null dereference on return in lambda attribute statement expr (PR #66643)

2023-09-18 Thread Shafik Yaghmour via cfe-commits
shafik wrote: LGTM https://github.com/llvm/llvm-project/pull/66643 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Shafik Yaghmour via cfe-commits
@@ -650,17 +642,16 @@ void ASTDeclWriter::VisitFunctionDecl(FunctionDecl *D) { DependentFunctionTemplateSpecializationInfo * DFTSInfo = D->getDependentSpecializationInfo(); -// Templates. -Record.push_back(DFTSInfo->getNumTemplates()); -for (int i=0, e =

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Shafik Yaghmour via cfe-commits
@@ -4086,7 +4073,7 @@ FunctionDecl *Sema::SubstSpaceshipAsEqualEqual(CXXRecordDecl *RD, Decl *R; if (auto *MD = dyn_cast(Spaceship)) { R = Instantiator.VisitCXXMethodDecl( -MD, nullptr, std::nullopt, +MD, nullptr, shafik wrote:

[clang-tools-extra] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Shafik Yaghmour via cfe-commits
@@ -4086,7 +4073,7 @@ FunctionDecl *Sema::SubstSpaceshipAsEqualEqual(CXXRecordDecl *RD, Decl *R; if (auto *MD = dyn_cast(Spaceship)) { R = Instantiator.VisitCXXMethodDecl( -MD, nullptr, std::nullopt, +MD, nullptr, shafik wrote: To be

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

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

[clang-tools-extra] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Mostly minor fixes and or questions. https://github.com/llvm/llvm-project/pull/66636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Shafik Yaghmour via cfe-commits
@@ -1016,21 +1003,20 @@ void ASTDeclReader::VisitFunctionDecl(FunctionDecl *FD) { } case FunctionDecl::TK_DependentFunctionTemplateSpecialization: { // Templates. -UnresolvedSet<8> TemplDecls; -unsigned NumTemplates = Record.readInt(); -while

[clang] [clang][Sema] Fix crash introduced in b2cd9db589335d5885c04df83003a623cf2f05ff (PR #66954)

2023-09-20 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Thanks for the quick fix! https://github.com/llvm/llvm-project/pull/66954 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [Clang] Fix crash when ill-formed code is treated as a deduction guide (PR #67373)

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

[clang] [Clang] Fix crash when ill-formed code is treated as a deduction guide (PR #67373)

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

[clang] [clang] Fix a crash from nested ArrayInitLoopExpr (PR #67722)

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

[clang] [clang] Fix a crash from nested ArrayInitLoopExpr (PR #67722)

2023-09-29 Thread Shafik Yaghmour via cfe-commits
@@ -10977,6 +10987,9 @@ bool ArrayExprEvaluator::VisitArrayInitLoopExpr(const ArrayInitLoopExpr *E) { return false; Success = false; } + +// Make sure we run the destructors too. +Scope.destroy(); shafik wrote: So we don't have to

[clang] [clang] Fix a crash from nested ArrayInitLoopExpr (PR #67722)

2023-09-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Apologies for the post commit review, just have one question. https://github.com/llvm/llvm-project/pull/67722 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][Interp] Zero-init remaining string literal elements (PR #66862)

2023-09-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. https://github.com/llvm/llvm-project/pull/66862 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [Clang] Fix crash when ill-formed code is treated as a deduction guide (PR #67373)

2023-09-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/67373 >From beab5db738483795ecb0bace2842acdbb1c9869a Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Mon, 25 Sep 2023 13:56:43 -0700 Subject: [PATCH] [Clang] Fix crash when ill-formed code is treated as a

[clang-tools-extra] [Clang] Fix crash when ill-formed code is treated as a deduction guide (PR #67373)

2023-10-02 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik closed https://github.com/llvm/llvm-project/pull/67373 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [Clang] Fix crash when ill-formed code is treated as a deduction guide (PR #67373)

2023-09-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/67373 >From beab5db738483795ecb0bace2842acdbb1c9869a Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Mon, 25 Sep 2023 13:56:43 -0700 Subject: [PATCH] [Clang] Fix crash when ill-formed code is treated as a

[clang] [clang][Interp] Fix returning nullptr from functions (PR #67229)

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

[clang] [clang][Interp] Fix returning nullptr from functions (PR #67229)

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

[clang] [clang][Interp] Fix returning nullptr from functions (PR #67229)

2023-09-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/67229 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Fix returning nullptr from functions (PR #67229)

2023-09-29 Thread Shafik Yaghmour via cfe-commits
@@ -209,7 +209,7 @@ bool Ret(InterpState , CodePtr , APValue ) { // FIXME: We could be calling isLive() here, but the emitted diagnostics // seem a little weird, at least if the returned expression is of // pointer type. shafik wrote: Can we add

<    1   2   3   4   5   6   7   >