[clang] [clang] Add tests for some CWG issues from 2024-05-31 telecon (PR #94167)

2024-06-03 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: LGTM, curious why you skipped some and not others from that telecom. Likely folks won't be able to check out the DRs until after St Louis. https://github.com/llvm/llvm-project/pull/94167 ___ cfe-commits mailing

[clang] [clang] Add tests for Core issues about friend templates (PR #94288)

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

[clang] [clang] Add tests for Core issues about friend templates (PR #94288)

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

[clang] [clang] Add tests for Core issues about friend templates (PR #94288)

2024-06-03 Thread Shafik Yaghmour via cfe-commits
@@ -121,6 +145,21 @@ derived d2(42, 9); #endif } +namespace cwg1945 { // cwg1945: no +template struct A { + class B { +class C {}; + }; +}; +class X { + static int x; + // FIXME: this is ill-formed, because A::B::C does not end with a simple-template-id + template

[clang] [clang] Add tests for Core issues about friend templates (PR #94288)

2024-06-03 Thread Shafik Yaghmour via cfe-commits
@@ -373,6 +373,98 @@ namespace cwg1837 { // cwg1837: 3.3 #endif } +namespace cwg1862 { // cwg1862: no +template +struct A { + struct B { +void e(); + }; + + void f(); + + struct D { +void g(); + }; + + T h(); + + template + T i(); +}; + +template<>

[clang] [clang] Add tests for Core issues about friend templates (PR #94288)

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

[clang] [clang] Add tests for Core issues about friend templates (PR #94288)

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

[clang] [Clang] Correctly diagnose a static function overloading a non-static function (PR #93460)

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

[clang] [clang] Improve ast-dumper text printing of TemplateArgument (PR #93431)

2024-05-28 Thread Shafik Yaghmour via cfe-commits
@@ -947,6 +947,26 @@ void TextNodeDumper::dumpDeclRef(const Decl *D, StringRef Label) { }); } +void TextNodeDumper::dumpTemplateArgument(const TemplateArgument ) { + llvm::SmallString<128> Str; + { +llvm::raw_svector_ostream SS(Str); +TA.print(PrintPolicy, SS,

[clang] [clang] require template arg list after template kw (PR #80801)

2024-05-28 Thread Shafik Yaghmour via cfe-commits
@@ -2995,13 +2996,23 @@ bool Parser::ParseUnqualifiedId(CXXScopeSpec , ParsedType ObjectType, SS, ObjectType, ObjectHadErrors, TemplateKWLoc ? *TemplateKWLoc : SourceLocation(), Id, IdLoc, EnteringContext, Result, TemplateSpecified); -else if

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

2024-04-29 Thread Shafik Yaghmour via cfe-commits
@@ -6714,14 +6714,16 @@ void Sema::CodeCompleteQualifiedId(Scope *S, CXXScopeSpec , // If the scope is a concept-constrained type parameter, infer nested // members based on the constraints. - if (const auto *TTPT = - dyn_cast_or_null(NNS->getAsType())) { -

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

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

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

2024-04-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: So this seems to apply to member pointer types, pointer types, arrays and function types but I don't see coverage for the full set of paths in the tests. Can we please add more testing. Erich also expressed some concern about breaking existing code due to

[clang] [clang][NFC] Reformat suspicious condition (PR #89923)

2024-04-29 Thread Shafik Yaghmour via cfe-commits
shafik wrote: The `amdgpu-toolchain.c` test failure looks unrelated. I think we need another empty commit to kick off the build again unfortunately. https://github.com/llvm/llvm-project/pull/89923 ___ cfe-commits mailing list

[clang] [NFC] Fix hasQualifier comment (PR #90485)

2024-04-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. LGTM, thank you for the documentation fix. https://github.com/llvm/llvm-project/pull/90485 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang] Implement P2809: Trivial infinite loops are not Undefined Behavior (PR #90066)

2024-04-29 Thread Shafik Yaghmour via cfe-commits
@@ -908,6 +908,74 @@ void CodeGenFunction::EmitIfStmt(const IfStmt ) { incrementProfileCounter(); } +bool CodeGenFunction::checkIfLoopMustProgress(const Expr *ControllingExpression, + bool IsTrivialCXXLoop) { + if

[clang] [Clang] Implement P2809: Trivial infinite loops are not Undefined Behavior (PR #90066)

2024-04-29 Thread Shafik Yaghmour via cfe-commits
@@ -1465,6 +1465,7 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn, // Ensure that the function adheres to the forward progress guarantee, which // is required by certain optimizations. + // The attribute will be removed if the body contains a

[clang] [clang] MangledSymbol: remove pointless copy of vector (PR #90012)

2024-04-25 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > Looking at the logs, and the error seems to be unrelated to the changes made > https://buildkite.com/llvm-project/clang-ci/builds/16430#018f132d-506e-440c-b18b-fed98237def9/54-5446 You can try using `--allow-empty` to do an empty commit to kick off the build again.

[clang] [clang][NFC] Reformat suspicious condition (PR #89923)

2024-04-24 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: This makes sense, I added Nico since they added the change that brought in that line. https://github.com/llvm/llvm-project/pull/89923 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] MangledSymbol: remove pointless copy of vector (PR #90012)

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

[clang] [clang] Reject VLAs in `__is_layout_compatible()` (PR #87737)

2024-04-05 Thread Shafik Yaghmour via cfe-commits
@@ -1741,8 +1741,10 @@ void is_layout_compatible(int n) static_assert(!__is_layout_compatible(unsigned char, signed char)); static_assert(__is_layout_compatible(int[], int[])); static_assert(__is_layout_compatible(int[2], int[2])); -

[clang] [Clang][Sema] Fix the lambda call expression inside of a type alias declaration (PR #82310)

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

[clang] [clang][ExprConst] allow single element access of vector object to be constant expression (PR #72607)

2024-04-04 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: This mostly makes sense to me, @AaronBallman does this look good to you? https://github.com/llvm/llvm-project/pull/72607 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2024-04-04 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); +

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

2024-04-04 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); +

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

2024-04-04 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); +

[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

[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][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 , SemaRef.Diag(OwnedTagDecl->getLocation(), DiagID) << SemaRef.Context.getTypeDeclType(OwnedTagDecl); D.setInvalidType(true); +

[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 , SemaRef.Diag(OwnedTagDecl->getLocation(), DiagID) << SemaRef.Context.getTypeDeclType(OwnedTagDecl); D.setInvalidType(true); +

[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

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

[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

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

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

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

[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

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

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

[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] [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] [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
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] [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] [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 , // 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][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.

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

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

[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

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

[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] [clang] Sequence C++20 Parenthesized List Init (PR #83476)

2024-03-04 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] Fix null-deref thanks to an attribute on a global declarator chunk (PR #83611)

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

[clang] [Clang] [Sema] Do not attempt to dump the layout of dependent types when `-fdump-record-layouts-complete` is passed (PR #83688)

2024-03-02 Thread Shafik Yaghmour via cfe-commits
@@ -5042,7 +5042,7 @@ void RecordDecl::completeDefinition() { // Layouts are dumped when computed, so if we are dumping for all complete // types, we need to force usage to get types that wouldn't be used elsewhere. - if (Ctx.getLangOpts().DumpRecordLayoutsComplete) +

[clang] [Clang] [Sema] Do not attempt to dump the layout of dependent types when `-fdump-record-layouts-complete` is passed (PR #83688)

2024-03-02 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I think this makes sense but I would like another set of eyes. https://github.com/llvm/llvm-project/pull/83688 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang] [Sema] Do not attempt to dump the layout of dependent types when `-fdump-record-layouts-complete` is passed (PR #83688)

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

[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 edited https://github.com/llvm/llvm-project/pull/83686 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[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 edited https://github.com/llvm/llvm-project/pull/83686 ___ 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   >