[clang] [clang] Optimize castToDeclContext for 2% improvement in build times (PR #76825)

2024-01-03 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Please add a detailed summary for this PR. The summary is what usually goes into the git log and it is important that the git log is useful for quick understanding of changes without having to dig into the details. https://github.com/llvm/llvm-project/pul

[clang] [clang] Optimize castToDeclContext for 2% improvement in build times (PR #76825)

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

[clang] [clang] Fix behavior of `__is_trivially_relocatable(volatile int)` (PR #77092)

2024-01-05 Thread Shafik Yaghmour via cfe-commits
shafik wrote: I think I would like some more eyes on this, I don't know if it is obvious to me what it means to reallocate a volatile object. https://github.com/llvm/llvm-project/pull/77092 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang] [clang] move -Wcast-function-type under -Wextra (PR #77178)

2024-01-05 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: This should have a release note and I think this is a potentially breaking change since folks using `Wextra` may get this diagnostic now. https://github.com/llvm/llvm-project/pull/77178 ___ cfe-commits mailing list

[clang] [Clang] Wide delimiters ('{{{') for expect strings (PR #77326)

2024-01-08 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Can we add a few tests for this change? https://github.com/llvm/llvm-project/pull/77326 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ASTMatchers] fix captureVars assertion failure on capturesVariables (PR #76619)

2024-01-08 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thank you for the fix, can you add more details to your summary. The summary is what usually goes into the git log. We would like those to be as descriptive as possible to avoid having to do extra digging to understand the change at a high level. https://

[clang] [clang][Parser] Pop scope prior VarDecl invalidating by invalid init (PR #77434)

2024-01-09 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: This makes sense to me but I would like @cor3ntin to review as well. This needs a release note. I see that there was two test cases. Do you think it is worth it to add the second test case as well? https://github.com/llvm/llvm-project/pull/77434 __

[clang] Fix crash with modules and constexpr destructor (PR #69076)

2024-01-09 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > ping @shafik @cor3ntin @ChuanqiXu9, how can we make progress here? Please add a release note and address my previous comment: https://github.com/llvm/llvm-project/pull/69076#issuecomment-1780327252 CC @cor3ntin https://github.com/llvm/llvm-project/pull/69076 _

[clang] [clang] Disable missing definition warning on pure virtual functions (PR #74510)

2024-01-11 Thread Shafik Yaghmour via cfe-commits
@@ -18931,7 +18931,7 @@ void Sema::MarkFunctionReferenced(SourceLocation Loc, FunctionDecl *Func, // constant evaluated bool NeededForConstantEvaluation = isPotentiallyConstantEvaluatedContext(*this) && - isImplicitlyDefinableConstexprFunction(Func); + is

[clang] a371058 - [Clang] Diagnose ill-formed constant expression when setting a non fixed enum to a value outside the range of the enumeration values

2022-07-27 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2022-07-27T14:59:35-07:00 New Revision: a3710589f285de0bb22ff92b1fc24df9411e986f URL: https://github.com/llvm/llvm-project/commit/a3710589f285de0bb22ff92b1fc24df9411e986f DIFF: https://github.com/llvm/llvm-project/commit/a3710589f285de0bb22ff92b1fc24df9411e986f.dif

[clang] 28cd7f8 - Revert "[Clang] Diagnose ill-formed constant expression when setting a non fixed enum to a value outside the range of the enumeration values"

2022-07-27 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2022-07-27T15:31:41-07:00 New Revision: 28cd7f86ed0e94ea3ae56a49ba85f0ccb7b51dd4 URL: https://github.com/llvm/llvm-project/commit/28cd7f86ed0e94ea3ae56a49ba85f0ccb7b51dd4 DIFF: https://github.com/llvm/llvm-project/commit/28cd7f86ed0e94ea3ae56a49ba85f0ccb7b51dd4.dif

[clang] a0d6105 - [Clang] Fix handling of Max from getValueRange(...) in IntExprEvaluator::VisitCastExpr(...)

2022-07-29 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2022-07-29T19:17:42-07:00 New Revision: a0d61051628825e2f394240dc442ad5d81fa78bc URL: https://github.com/llvm/llvm-project/commit/a0d61051628825e2f394240dc442ad5d81fa78bc DIFF: https://github.com/llvm/llvm-project/commit/a0d61051628825e2f394240dc442ad5d81fa78bc.dif

[clang] cc10411 - [Clang] Allow downgrading to a warning the diagnostic for setting a non fixed enum to a value outside the range of the enumeration values

2022-08-08 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2022-08-08T16:23:07-07:00 New Revision: cc104113ddecbdcec2cca848adbb6afa1214e9de URL: https://github.com/llvm/llvm-project/commit/cc104113ddecbdcec2cca848adbb6afa1214e9de DIFF: https://github.com/llvm/llvm-project/commit/cc104113ddecbdcec2cca848adbb6afa1214e9de.dif

[clang] 4e45876 - [Clang] Restrict non fixed enum to a value outside the range of the enumeration values warning to context requiring a constant expression

2022-08-10 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2022-08-10T11:12:01-07:00 New Revision: 4e458765aaef7988e687e190d865f331727825c0 URL: https://github.com/llvm/llvm-project/commit/4e458765aaef7988e687e190d865f331727825c0 DIFF: https://github.com/llvm/llvm-project/commit/4e458765aaef7988e687e190d865f331727825c0.dif

[clang] 5ff992b - [DEBUG-INFO] Change how we handle auto return types for lambda operator() to be consistent with gcc

2022-04-21 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2022-04-21T14:58:50-07:00 New Revision: 5ff992bca208a0e37ca6338fc735aec6aa848b72 URL: https://github.com/llvm/llvm-project/commit/5ff992bca208a0e37ca6338fc735aec6aa848b72 DIFF: https://github.com/llvm/llvm-project/commit/5ff992bca208a0e37ca6338fc735aec6aa848b72.dif

[clang] f56cb52 - [DEBUGINFO] [LLDB] Add support for generating debug-info for structured bindings of structs and arrays

2022-02-17 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2022-02-17T11:14:14-08:00 New Revision: f56cb520d8554ca42a215e82ecfa58d0b6c178e4 URL: https://github.com/llvm/llvm-project/commit/f56cb520d8554ca42a215e82ecfa58d0b6c178e4 DIFF: https://github.com/llvm/llvm-project/commit/f56cb520d8554ca42a215e82ecfa58d0b6c178e4.dif

[clang] 80dec2e - [Clang] Modify CXXMethodDecl::isMoveAssignmentOperator() to look through type sugar

2022-07-14 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2022-07-14T16:09:52-07:00 New Revision: 80dec2ecfffe30f86ecfeec8f553b16bb992c48b URL: https://github.com/llvm/llvm-project/commit/80dec2ecfffe30f86ecfeec8f553b16bb992c48b DIFF: https://github.com/llvm/llvm-project/commit/80dec2ecfffe30f86ecfeec8f553b16bb992c48b.dif

[clang] aea82d4 - [Clang] Fix how we set the NumPositiveBits on an EnumDecl to cover the case of single enumerator with value zero or an empty enum

2022-07-25 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2022-07-25T16:01:01-07:00 New Revision: aea82d4551139ded0290afab739f0b367d055628 URL: https://github.com/llvm/llvm-project/commit/aea82d4551139ded0290afab739f0b367d055628 DIFF: https://github.com/llvm/llvm-project/commit/aea82d4551139ded0290afab739f0b367d055628.dif

[clang] nolock/noalloc attributes (PR #84983)

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

[clang] nolock/noalloc attributes (PR #84983)

2024-03-13 Thread Shafik Yaghmour via cfe-commits
@@ -4181,6 +4185,127 @@ class FunctionNoProtoType : public FunctionType, public llvm::FoldingSetNode { } }; +class FunctionEffect; +class FunctionEffectSet; + +// It is the user's responsibility to keep this in set form: elements are +// ordered and unique. +// We could hid

[clang] nolock/noalloc attributes (PR #84983)

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

[clang] nolock/noalloc attributes (PR #84983)

2024-03-13 Thread Shafik Yaghmour via cfe-commits
@@ -4181,6 +4185,127 @@ class FunctionNoProtoType : public FunctionType, public llvm::FoldingSetNode { } }; +class FunctionEffect; +class FunctionEffectSet; + +// It is the user's responsibility to keep this in set form: elements are +// ordered and unique. +// We could hid

[clang] [Sema] Allow -Wno-main to suppress the arg wrong error (PR #85494)

2024-03-16 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I believe this should have a release note. https://github.com/llvm/llvm-project/pull/85494 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Ignore assumptions with side effects at compile time (PR #85534)

2024-03-16 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: This is not really an NFC change so you should have waited for an approval. This LGTM https://github.com/llvm/llvm-project/pull/85534 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [clang] CTAD: Track template template type parameters that referenced in (PR #85405)

2024-03-27 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: LGTM, I will let @ilya-biryukov approve https://github.com/llvm/llvm-project/pull/85405 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix an out-of-bound crash when checking template partial specializations. (PR #86794)

2024-03-27 Thread Shafik Yaghmour via cfe-commits
@@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++20 -verify %s +// RUN: %clang_cc1 -std=c++20 -ferror-limit 0 -verify %s shafik wrote: Why the `ferror-limit 0`? https://github.com/llvm/llvm-project/pull/86794 ___ cfe-commit

[clang] [clang] Invalidate the alias template decl if it has multiple written (PR #85413)

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

[clang] [clang] Bailout when the substitution of template parameter mapping is invalid. (PR #86869)

2024-03-27 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. LGTM, interesting it looks like we don't do this check in `fromContraintExpr` either. https://github.com/llvm/llvm-project/pull/86869 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[clang] [clang] Add test for CWG1606 (PR #87274)

2024-04-01 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. Thank you for the test! LGTM. Do we also have a test that `sizeof([=]{ return i + j;})` should fail as well? Tangentially related to this DR but if we don't we should cover that in our tests someplace. https://github.com/llvm/llvm-project/

[clang] [clang] Add test for CWG1606 (PR #87274)

2024-04-01 Thread Shafik Yaghmour via cfe-commits
shafik wrote: It looks like we do have a test and it looks like the restriction was lifted in C++20. https://github.com/llvm/llvm-project/pull/87274 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[clang] [Clang][Sema] set declaration invalid earlier to prevent crash in calculating record layout (PR #87173)

2024-04-01 Thread Shafik Yaghmour via cfe-commits
@@ -3899,6 +3899,9 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state, SemaRef.Diag(OwnedTagDecl->getLocation(), DiagID) << SemaRef.Context.getTypeDeclType(OwnedTagDecl); D.setInvalidType(true); + OwnedTagDecl->setCompleteDefi

[clang] [Clang][Sema] set declaration invalid earlier to prevent crash in calculating record layout (PR #87173)

2024-04-01 Thread Shafik Yaghmour via cfe-commits
@@ -3899,6 +3899,9 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state, SemaRef.Diag(OwnedTagDecl->getLocation(), DiagID) << SemaRef.Context.getTypeDeclType(OwnedTagDecl); D.setInvalidType(true); + OwnedTagDecl->setCompleteDefi

[clang] [Clang][Sema] Skip checking anonymous enum in using enum declaration (PR #87144)

2024-04-01 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: LGTM after addressing Aaron's comments. Can you elaborate more on the details of the bug in the summary. This goes into the git log and we want folks to be able to understand the problem well from the summary w/o having to do additional checks. Thank you

[clang] [clang]Treat arguments to builtin type traits as template type arguments (PR #87132)

2024-04-01 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: LGTM but I want @fahadnayyar to verify this addresses his concerns. https://github.com/llvm/llvm-project/pull/87132 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang] Diagnosis for constexpr constructor not initializing a union member Resolves #46689 (PR #81042)

2024-02-07 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thank you the PR. Your summary is blank but should describe the problem you are trying to solve, how the PR solves it and should at the end link to any llvm issues this relates to. Having solid summaries is critical since this is normally what one sees whe

[clang] [Clang][Sema] Diagnosis for constexpr constructor not initializing a union member (PR #81042)

2024-02-07 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -std=c++14 -verify -fcxx-exceptions -Werror=c++14-extensions -Werror=c++20-extensions %s + +template struct C { +union { + int i; +}; +constexpr C() {} // expected-error {{constexpr union constructor that does not initialize

[clang] [Clang][Sema] Diagnosis for constexpr constructor not initializing a union member (PR #81042)

2024-02-07 Thread Shafik Yaghmour via cfe-commits
@@ -224,6 +224,9 @@ struct TemplateInit { }; // FIXME: This is ill-formed (no diagnostic required). We should diagnose it. constexpr TemplateInit() {} // desired-error {{must initialize all members}} +#ifndef CXX2A shafik wrote: We normally do this using

[clang] [Clang][Parser] Have the depth of the abbreviated generic lambdas inside a requires clause differ from the surrounding generic lambda (PR #80656)

2024-02-07 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I think this makes sense but I would like @cor3ntin to approve. https://github.com/llvm/llvm-project/pull/80656 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[clang] [Clang][Parser] Have the depth of the abbreviated generic lambdas inside a requires clause differ from the surrounding generic lambda (PR #80656)

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

[clang] [Clang][Parser] Have the depth of the abbreviated generic lambdas inside a requires clause differ from the surrounding generic lambda (PR #80656)

2024-02-07 Thread Shafik Yaghmour via cfe-commits
@@ -168,3 +168,30 @@ auto lambda4 = [] requires(sizeof(char) == 1){}; // expected-error {{expected bo #if __cplusplus <= 202002L // expected-warning@-2{{lambda without a parameter clause is a C++23 extension}} #endif + +namespace GH78524 { + +template T Foo; + +template aut

[clang] [Clang][Parser] Have the depth of the abbreviated generic lambdas inside a requires clause differ from the surrounding generic lambda (PR #80656)

2024-02-07 Thread Shafik Yaghmour via cfe-commits
@@ -1385,6 +1385,11 @@ ExprResult Parser::ParseLambdaExpressionAfterIntroducer( Diag(RAngleLoc, diag::err_lambda_template_parameter_list_empty); } else { + // We increase the template depth before recursing into a requires-clause. + // The abbrev

[clang] Consider aggregate bases when checking if an InitListExpr is constant (PR #80519)

2024-02-07 Thread Shafik Yaghmour via cfe-commits
shafik wrote: @AaronBallman since this involves compound literals a C-ism, I would like you to review this as well. https://github.com/llvm/llvm-project/pull/80519 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

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

2024-02-08 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited 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] [SemaCXX] Implement CWG2351 `void{}` (PR #78060)

2024-02-08 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Just a quick question 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] [SemaCXX] Implement CWG2351 `void{}` (PR #78060)

2024-02-08 Thread Shafik Yaghmour via cfe-commits
@@ -1600,12 +1600,25 @@ Sema::BuildCXXTypeConstructExpr(TypeSourceInfo *TInfo, return ExprError(Diag(TyBeginLoc, diag::err_init_for_function_type) << Ty << FullRange); - // C++17 [expr.type.conv]p2: - // If the type is cv void and the initializer

[clang] [SemaCXX] Make __builtin_addressof more like std::addressof (PR #78035)

2024-02-08 Thread Shafik Yaghmour via cfe-commits
@@ -39,7 +39,43 @@ namespace addressof { struct U { int n : 5; } u; int *pbf = __builtin_addressof(u.n); // expected-error {{address of bit-field requested}} - S *ptmp = __builtin_addressof(S{}); // expected-error {{taking the address of a temporary}} expected-warning {

[clang] [clang-tools-extra] [Sema][clangd] add noexcept to override functions during code completion (PR #75937)

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

[clang] [clang-tools-extra] [Sema][clangd] add noexcept to override functions during code completion (PR #75937)

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

[clang] [clang-tools-extra] [Sema][clangd] add noexcept to override functions during code completion (PR #75937)

2024-02-09 Thread Shafik Yaghmour via cfe-commits
@@ -183,7 +184,7 @@ class ResultBuilder { /// Overloaded C++ member functions found by SemaLookup. /// Used to determine when one overload is dominated by another. - llvm::DenseMap, ShadowMapEntry> + llvm::DenseMap, ShadowMapEntry> shafik wrote: ```sugg

[clang] [C23] Do not diagnose binary literals as an extension (PR #81658)

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

[clang] [clang] Add some CodeGen tests for CWG 4xx issues (PR #83715)

2024-03-06 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Late review but LGTM https://github.com/llvm/llvm-project/pull/83715 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,54 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -I%S/Inputs -std=c++20 %s + +// expected-no-diagnostics + +#include "std-coroutine.h" + +using size_t = decltype(sizeof(0)); + +struct Generator { + struct promise_type { +int _val{}; + +Generator get_return_objec

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Shafik Yaghmour via cfe-commits
@@ -1434,13 +1434,18 @@ ExprResult Sema::ActOnCXXThis(SourceLocation Loc) { return Diag(Loc, diag::err_invalid_this_use) << 0; } - return BuildCXXThisExpr(Loc, ThisTy, /*IsImplicit=*/false); + return BuildCXXThisExpr(Loc, ThisTy, /*IsImplicit=*/false, +

[clang] [Clang] [Sema] No longer diagnose type definitions in `offsetof` in C23 mode (PR #84169)

2024-03-07 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Should we verify that we diagnose the case where the definition includes a comma? https://github.com/llvm/llvm-project/pull/84169 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-07 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,67 @@ +//===- SemaOpenACC.h - Semantic Analysis for OpenACC constructs ---===// +// +// 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: Apa

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-07 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I think this makes sense. https://github.com/llvm/llvm-project/pull/84184 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

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

[clang] [Clang][Sema] Fix type of enumerators in incomplete enumerations (PR #84068)

2024-03-07 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Should we also have a C++ test for this fix? https://github.com/llvm/llvm-project/pull/84068 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Error on explicit specialization of lambda call operator (PR #84343)

2024-03-08 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Can we please get more descriptive summaries in the future. We should at a minimum state 1) what the underlying problem is 2) what the approach for fixing the problem is. In this case the title describes the problem but it would be nice to have a summary of the fix as well. So f

[clang] [Clang][Sema] Fix type of enumerators in incomplete enumerations (PR #84068)

2024-03-08 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > So I believe: > > ``` > typedef enum EnumA { > A > } EnumA; > > enum EnumB { > B, > B1 = 1, > B2 = A == B1 > }; > ``` > > is not an enum compare warning in C++ because `B1` doesn't have an > enumeration type due to the enumeration not being fully-defined, and is not >

[clang] [Clang][Sema] Fix type of enumerators in incomplete enumerations (PR #84068)

2024-03-08 Thread Shafik Yaghmour via cfe-commits
@@ -6,7 +6,9 @@ typedef enum EnumA { } EnumA; enum EnumB { - B + B, shafik wrote: I think what I was asking, was do we have an equivalent C++ test that verifies in a `.cpp` file that we also do not obtain a diagnostic for this. https://github.com/llvm/llv

[clang] [Clang] Update missing varargs arg extension warnings (PR #84520)

2024-03-08 Thread Shafik Yaghmour via cfe-commits
@@ -993,11 +993,18 @@ MacroArgs *Preprocessor::ReadMacroCallArgumentList(Token &MacroName, // If the macro contains the comma pasting extension, the diagnostic // is suppressed; we know we'll get another diagnostic later. if (!MI->hasCommaPasting()) { -

[clang] [Clang] Update missing varargs arg extension warnings (PR #84520)

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

[clang] [Clang] Update missing varargs arg extension warnings (PR #84520)

2024-03-08 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Just a nit here. https://github.com/llvm/llvm-project/pull/84520 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20][Coroutines] lambda-coroutine with promise_type ctor. (PR #84519)

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

[clang] [C++20][Coroutines] lambda-coroutine with promise_type ctor. (PR #84519)

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

[clang] [C++20][Coroutines] lambda-coroutine with promise_type ctor. (PR #84519)

2024-03-08 Thread Shafik Yaghmour via cfe-commits
@@ -596,8 +596,21 @@ VarDecl *Sema::buildCoroutinePromise(SourceLocation Loc) { // Add implicit object parameter. if (auto *MD = dyn_cast(FD)) { -if (MD->isImplicitObjectMemberFunction() && !isLambdaCallOperator(MD)) { - ExprResult ThisExpr = ActOnCXXThis(Loc); +

[clang] [clang][Sema] Refine unused-member-function diagnostic message for constructors (PR #84515)

2024-03-08 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Looks like the build failed b/c you did not run `git clang-format` https://github.com/llvm/llvm-project/pull/84515 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix type of enumerators in incomplete enumerations (PR #84068)

2024-03-11 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > @shafik We dont have a dedicated cpp test for this. I can add one if you > want, but clang/test/Sema/warn-compare-enum-types-mismatch.c runs clang both > on C and C++ mode, so I didnt think it necessary. I think we just a bug that demonstrates this issue: https://github.com/ll

[clang] Diagnose misuse of the cleanup attribute (PR #80040)

2024-03-12 Thread Shafik Yaghmour via cfe-commits
shafik wrote: It looks like it passed on your last commit but you have a conflict now which you need to resolve. Can you merge or do you need help with that? https://github.com/llvm/llvm-project/pull/80040 ___ cfe-commits mailing list cfe-commits@lis

[clang] [Clang][Sema] Fix incorrect rejection default construction of union with nontrivial member (PR #82407)

2024-02-23 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/82407 >From 5fcaeaddccc0f7e370bf7bebce113d8d52e1b1bd Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Tue, 20 Feb 2024 11:22:39 -0800 Subject: [PATCH] [Clang][Sema] Fix incorrect rejection default construction of u

[clang] [clang][Diagnostic] Don't warn about binary literals when using C23. (PR #80244)

2024-02-23 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thank you for this PR. This change should have some tests to verify the behavior is correct. I am a little surprised that this does not change any existing tests but maybe we don't have good test coverage. https://github.com/llvm/llvm-project/pull/80244 ___

[clang] Refactor clang::Linkage (PR #80063)

2024-02-23 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Hello, the diff is only showing a single whitespace change which from the title does not seem the intent. https://github.com/llvm/llvm-project/pull/80063 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang] Diagnose misuse of the cleanup attribute (PR #80040)

2024-02-23 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: The failure of the Windows CI is due to a know problem w/ false detection of a virus. You can use `--allow-empty` to make an empty commit and restart the process. You have approval, so once it goes green you should be good to squash and merge. https://gith

[clang] [clang][Sema] Fix for enums overflowing (#24667) (PR #78742)

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

[clang] [clang][Sema] Fix for enums overflowing (#24667) (PR #78742)

2024-02-23 Thread Shafik Yaghmour via cfe-commits
@@ -18,6 +19,40 @@ enum x // expected-warning {{enumeration values exceed rang { y = -9223372036854775807LL-1, // expected-warning {{ISO C restricts enumerator values to range of 'int'}} z = 9223372036854775808ULL };// expected-warning {{ISO C restric

[clang] [clang][Sema] Fix for enums overflowing (#24667) (PR #78742)

2024-02-23 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I think a more appropriate title would be "Fix for overflow in enumerators" https://github.com/llvm/llvm-project/pull/78742 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [Clang][Sema] Fix incorrect rejection default construction of union with nontrivial member (PR #82407)

2024-02-23 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/82407 >From 5fcaeaddccc0f7e370bf7bebce113d8d52e1b1bd Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Tue, 20 Feb 2024 11:22:39 -0800 Subject: [PATCH] [Clang][Sema] Fix incorrect rejection default construction of u

[clang] [Clang][Sema] Fix incorrect rejection default construction of union with nontrivial member (PR #82407)

2024-02-23 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/82407 >From 5fcaeaddccc0f7e370bf7bebce113d8d52e1b1bd Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Tue, 20 Feb 2024 11:22:39 -0800 Subject: [PATCH] [Clang][Sema] Fix incorrect rejection default construction of u

[clang] [clang] Add -Wmissing-designated-field-initializers (PR #81364)

2024-02-26 Thread Shafik Yaghmour via cfe-commits
@@ -120,6 +120,10 @@ Non-comprehensive list of changes in this release New Compiler Flags -- +- ``-Wmissing-designated-field-initializers``, grouped under ``-Wmissing-designated-field-initializers``. shafik wrote: CC @AaronBallman https://g

[clang] [Clang][Sema] placement new initializes typedef array with correct size (PR #83124)

2024-02-27 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,19 @@ +// RUN: %clang++ -S -emit-llvm -o - %s | FileCheck %s +#include + +// CHECK: call void @llvm.memset.p0.i64(ptr align 1 %x, i8 0, i64 8, i1 false) +// CHECK: call void @llvm.memset.p0.i64(ptr align 16 %x, i8 0, i64 32, i1 false) +template shafi

[clang] [Clang][Sema] placement new initializes typedef array with correct size (PR #83124)

2024-02-27 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Thank you for this fix. Can you put more details in your summary. The approach I like to take is 1. what the problem is 2. what is the approach of the fix 3. any other important details. https://github.com/llvm/llvm-project/pull/83124

[clang] [Clang][Sema] placement new initializes typedef array with correct size (PR #83124)

2024-02-27 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Can you explain which cases the `if (!ArraySize)` condition was catching before and why the change does not effect those cases? My fear is that we are breaking other cases but we don't have test coverage for those cases and we are missing those breaks. https://github.com/llvm/ll

[clang] [Clang][Sema]: Diagnose lambda to bool implicit casts (PR #83152)

2024-02-28 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thank you for this fix. I am happy the changes were not too different from my suggestion. Sometimes problems end up being more difficult then they seem initially. https://github.com/llvm/llvm-project/pull/83152 __

[clang] [Clang][Sema]: Diagnose lambda to bool implicit casts (PR #83152)

2024-02-28 Thread Shafik Yaghmour via cfe-commits
@@ -16538,6 +16538,17 @@ void Sema::DiagnoseAlwaysNonNullPointer(Expr *E, } } + // Complain if we are converting a lambda expression to a boolean value + if (const auto *MCallExpr = dyn_cast(E)) { +if (const auto *MRecordDecl = MCallExpr->getRecordDecl(); +

[clang] [Clang][Sema]: Diagnose lambda to bool implicit casts (PR #83152)

2024-02-28 Thread Shafik Yaghmour via cfe-commits
@@ -16538,6 +16538,17 @@ void Sema::DiagnoseAlwaysNonNullPointer(Expr *E, } } + // Complain if we are converting a lambda expression to a boolean value + if (const auto *MCallExpr = dyn_cast(E)) { +if (const auto *MRecordDecl = MCallExpr->getRecordDecl(); +

[clang] [Clang][Sema]: Diagnose lambda to bool implicit casts (PR #83152)

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

[clang] [Clang][Sema] Fix NULL dereferences for invalid references (PR #77703)

2024-02-28 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik requested changes to this pull request. I don't believe this is the right approach. I can only replicate one of the issues: https://godbolt.org/z/7dee3a3cY I spent some time looking at it and it is quite gnarly but we need to understand better what is going on. htt

[clang] [clang][Sema] Warn on self move for inlined static cast (PR #76646)

2024-02-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. LGTM, any objections @tbaederr https://github.com/llvm/llvm-project/pull/76646 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Warn on self move for inlined static cast (PR #76646)

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

[clang] [clang][Sema] Warn on self move for inlined static cast (PR #76646)

2024-02-29 Thread Shafik Yaghmour via cfe-commits
@@ -35,11 +41,14 @@ class field_test { int x; field_test(field_test&& other) { x = std::move(x); // expected-warning{{explicitly moving}} +x = static_cast(x); // expected-warning{{explicitly moving}} shafik wrote: Can you add some tests where we

[clang] [clang] Add `clang::behaves_like_std(...)` attribute (PR #76596)

2024-02-29 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Adding @AaronBallman and @erichkeane for a wider audience https://github.com/llvm/llvm-project/pull/76596 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Sequence C++20 Parenthesized List Init (PR #83476)

2024-02-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: LGTM after addressing comment. https://github.com/llvm/llvm-project/pull/83476 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Sequence C++20 Parenthesized List Init (PR #83476)

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

[clang] [clang] Sequence C++20 Parenthesized List Init (PR #83476)

2024-02-29 Thread Shafik Yaghmour via cfe-commits
@@ -17615,31 +17615,28 @@ class SequenceChecker : public ConstEvaluatedExprVisitor { return VisitExpr(CCE); // In C++11, list initializations are sequenced. -SmallVector Elts; -SequenceTree::Seq Parent = Region; -for (CXXConstructExpr::const_arg_iterator

[clang] [clang] Sequence C++20 Parenthesized List Init (PR #83476)

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

[clang] [Clang][Sema] Fix incorrect rejection default construction of union with nontrivial member (PR #82407)

2024-02-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/82407 >From 5fcaeaddccc0f7e370bf7bebce113d8d52e1b1bd Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Tue, 20 Feb 2024 11:22:39 -0800 Subject: [PATCH] [Clang][Sema] Fix incorrect rejection default construction of u

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-01 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Note, I opened an issue for this here: https://github.com/llvm/llvm-project/issues/83385 https://github.com/llvm/llvm-project/pull/83611 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

2024-03-01 Thread Shafik Yaghmour via cfe-commits
@@ -100,6 +100,12 @@ void AttributePool::takePool(AttributePool &pool) { pool.Attrs.clear(); } +void AttributePool::takeFrom(ParsedAttributesView &List, AttributePool &Pool) { + assert(&Pool != this && "AttributePool can't take attributes from itself"); + llvm::for_each(Li

[clang] [clang][AST] fix dereference on class/struct layouts check. (PR #83686)

2024-03-02 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik requested changes to this pull request. We need a minimal reproducer here. Looking at the bug report it is not clear to me if this is the correct fix or not. After we have a reproducer we would need a test added to the PR and a release note. https://github.com/llvm/ll

<    1   2   3   4   5   6   7   8   9   10   >