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

2023-10-25 Thread Shafik Yaghmour via cfe-commits
shafik wrote: The clang-format error is a false positive. https://github.com/llvm/llvm-project/pull/70150 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2023-10-25 Thread Shafik Yaghmour via cfe-commits
shafik wrote: The clang-format error is a false positive. https://github.com/llvm/llvm-project/pull/70150 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[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] 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] static operators should evaluate object argument (PR #68485)

2023-10-10 Thread Shafik Yaghmour via cfe-commits
@@ -5536,10 +5538,24 @@ RValue CodeGenFunction::EmitCall(QualType CalleeType, const CGCallee break; } } + +if (const auto *MD = +dyn_cast_if_present(OCE->getCalleeDecl()); +MD && MD->isStatic()) + StaticOperator = true; } -

[clang] [clang] static operators should evaluate object argument (PR #68485)

2023-10-10 Thread Shafik Yaghmour via cfe-commits
@@ -7806,7 +7806,8 @@ class ExprEvaluatorBase // Overloaded operator calls to member functions are represented as normal // calls with '*this' as the first argument. const CXXMethodDecl *MD = dyn_cast(FD); - if (MD &&

[clang] [clang] static operators should evaluate object argument (PR #68485)

2023-10-10 Thread Shafik Yaghmour via cfe-commits
@@ -5536,10 +5538,24 @@ RValue CodeGenFunction::EmitCall(QualType CalleeType, const CGCallee break; } } + +if (const auto *MD = +dyn_cast_if_present(OCE->getCalleeDecl()); +MD && MD->isStatic()) + StaticOperator = true; } -

[clang] [clang][Sema] Emit more specific diagnostic for auto in lambda before C++14 (#46059) (PR #68540)

2023-10-10 Thread Shafik Yaghmour via cfe-commits
@@ -3605,8 +3605,11 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState , Info = (); } else { // In C++14, generic lambdas allow 'auto' in their parameters. -if (!SemaRef.getLangOpts().CPlusPlus14 || !Auto || -

[clang] [Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy) (PR #68620)

2023-10-10 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > FWIW, I spoke offline with the original author of the PR and he said that > he's fine with me picking up the changes and carrying the review forward. > > Because I don't know of any better way to commandeer a patch in GitHub, I'll > probably grab the changes, get them into my

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

2023-10-09 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. LGTM, just fill out the description with some more details so folks reading git log will have more context, https://github.com/llvm/llvm-project/pull/67147 ___ cfe-commits mailing list

[clang] [clang] Ignore GCC 11 `[[malloc(x)]]` attribute (PR #68059)

2023-10-09 Thread Shafik Yaghmour via cfe-commits
@@ -1629,6 +1629,8 @@ def IFunc : Attr, TargetSpecificAttr { def Restrict : InheritableAttr { let Spellings = [Declspec<"restrict">, GCC<"malloc">]; + let Args = [IdentifierArgument<"Deallocator", /*opt*/ 1>, + ParamIdxArgument<"DeallocatorPtrArgIndex",

[clang] [clang] Ignore GCC 11 `[[malloc(x)]]` attribute (PR #68059)

2023-10-09 Thread Shafik Yaghmour via cfe-commits
@@ -1629,6 +1629,8 @@ def IFunc : Attr, TargetSpecificAttr { def Restrict : InheritableAttr { let Spellings = [Declspec<"restrict">, GCC<"malloc">]; + let Args = [IdentifierArgument<"Deallocator", /*opt*/ 1>, + ParamIdxArgument<"DeallocatorPtrArgIndex",

[clang] [clang] Ignore GCC 11 `[[malloc(x)]]` attribute (PR #68059)

2023-10-09 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Just a nit https://github.com/llvm/llvm-project/pull/68059 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Ignore GCC 11 `[[malloc(x)]]` attribute (PR #68059)

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

[clang] [Sema] Add check for bitfield assignments to larger integral types (PR #68276)

2023-10-04 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Why not wrap this into `-Wconversion` on clang as well? https://github.com/llvm/llvm-project/pull/68276 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][doc] Add documentation for the ASTs used to represent C++ templates (PR #66436)

2023-10-04 Thread Shafik Yaghmour via cfe-commits
shafik wrote: I would hate to lose the non-diagram part of this documentation. Do the criticism mainly apply to the diagrams and the text documentation is ok for most? https://github.com/llvm/llvm-project/pull/66436 ___ cfe-commits mailing list

[clang] [clang] fix hasAnyBase not binding submatchers (PR #67939)

2023-10-04 Thread Shafik Yaghmour via cfe-commits
shafik wrote: I think you should also add `[ASTMatcher]` to the subject after `[Clang]` at least that is what past PRs seem to do. https://github.com/llvm/llvm-project/pull/67939 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

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

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

2023-10-04 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-10-04 Thread Shafik Yaghmour via cfe-commits
@@ -14143,8 +14145,9 @@ static void AnalyzeComparison(Sema , BinaryOperator *E) { } // Otherwise, calculate the effective range of the signed operand. - IntRange signedRange = GetExprRange( - S.Context, signedOperand, S.isConstantEvaluated(), /*Approximate*/ true);

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

2023-10-04 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. LGTM after fixing nits. https://github.com/llvm/llvm-project/pull/66222 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

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

[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 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] 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] 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
@@ -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] [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] [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] 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] [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] 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] [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-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] [NFC][clang] change remaining context-dependent type nodes to ContextualFoldingSet (PR #67751)

2023-10-02 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Thank you for improving the description. The description is usually what ends up in the git log and so it is important for that summary there to be as helpful and descriptive as possible. https://github.com/llvm/llvm-project/pull/67751

[clang] [clang] Add test for CWG2267 (PR #67931)

2023-10-02 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/67931 ___ 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-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] [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] [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
@@ -2411,10 +2411,15 @@ static bool CheckEvaluationResult(CheckEvaluationResultKind CERK, const FieldDecl *SubobjectDecl, CheckedTemporaries ) { if (!Value.hasValue()) { -assert(SubobjectDecl &&

[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] [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] [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] [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
@@ -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 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] [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] [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][Interp] Handle CXXScalarValueInitExprs (PR #67147)

2023-09-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. 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-29 Thread Shafik Yaghmour via cfe-commits
@@ -31,6 +31,33 @@ static_assert(b, ""); constexpr int one = true; static_assert(one == 1, ""); +constexpr bool b2 = bool(); +static_assert(!b2, ""); + +namespace ScalarTypes { + constexpr int ScalarInitInt = int(); + static_assert(ScalarInitInt == 0, ""); + constexpr

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

2023-09-29 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] 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
@@ -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

[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
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] 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] [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] 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 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 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-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-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-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] 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] [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

[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

[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] [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 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
@@ -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 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

[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] 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] [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] 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] 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-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] [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
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-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 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-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-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 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
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] 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
@@ -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 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 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 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-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 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][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

<    1   2   3   4   5   6   7   >