[clang] [clang] Clang should detect illegal copy constructor with template class as its parameter (PR #81251)

2024-02-22 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: This also needs a release note. https://github.com/llvm/llvm-project/pull/81251 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Clang should detect illegal copy constructor with template class as its parameter (PR #81251)

2024-02-22 Thread Shafik Yaghmour via cfe-commits
shafik wrote: @cor3ntin the fix looks like the one you recommended but that is quite a lot of tests that fail. https://github.com/llvm/llvm-project/pull/81251 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [Clang][Sema] Fix missing warning when comparing mismatched enums in … (PR #81418)

2024-02-22 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,42 @@ +// RUN: %clang_cc1 -x c -fsyntax-only -verify -Wenum-compare -Wno-unused-comparison %s +// RUN: %clang_cc1 -x c++ -fsyntax-only -verify -Wenum-compare -Wno-unused-comparison %s + +typedef enum EnumA { + A +} EnumA; + +enum EnumB { + B +}; + +enum { + C +}; +

[clang] [Clang][Sema] Fix missing warning when comparing mismatched enums in … (PR #81418)

2024-02-22 Thread Shafik Yaghmour via cfe-commits
@@ -263,6 +263,14 @@ namespace { } } +QualType Expr::getEnumCoercedType(const ASTContext &Ctx) const { + bool NotEnumType = dyn_cast(this->getType()) == nullptr; + if (NotEnumType) shafik wrote: This look redundant since `getEnumConstantDecl()` will just

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-02-21 Thread Shafik Yaghmour via cfe-commits
@@ -1760,6 +1760,21 @@ class BuiltinTemplateDecl : public TemplateDecl { BuiltinTemplateKind getBuiltinTemplateKind() const { return BTK; } }; +/// Provides information about an explicit instantiation of a variable or class +/// template. +struct ExplicitInstantiationInfo {

[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-02-21 Thread Shafik Yaghmour via cfe-commits
@@ -1760,6 +1760,21 @@ class BuiltinTemplateDecl : public TemplateDecl { BuiltinTemplateKind getBuiltinTemplateKind() const { return BTK; } }; +/// Provides information about an explicit instantiation of a variable or class +/// template. +struct ExplicitInstantiationInfo {

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

2024-02-21 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-21 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-21 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] Fix assert when transforming a pack indexing type. (PR #82234)

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

[clang] [clang] [SemaCXX] Disallow deducing "this" on operator `new` and `delete` (PR #82251)

2024-02-20 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. LGTM, thanks for submitting a fix. https://github.com/llvm/llvm-project/pull/82251 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-02-20 Thread Shafik Yaghmour via cfe-commits
@@ -2471,6 +2480,23 @@ static bool CheckConstexprFunctionBody(Sema &SemaRef, const FunctionDecl *Dcl, return true; } +static bool +checkUnionConstructorIntializer(Sema &SemaRef, const FunctionDecl *Dcl, +const CXXConstructorDecl *Constructor,

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

2024-02-20 Thread Shafik Yaghmour via cfe-commits
@@ -2343,17 +2349,9 @@ static bool CheckConstexprFunctionBody(Sema &SemaRef, const FunctionDecl *Dcl, // - if the class is a union having variant members, exactly one of them // shall be initialized; shafik wrote: We need add a reference to [cwg2424]

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

2024-02-20 Thread Shafik Yaghmour via cfe-commits
@@ -2471,6 +2480,23 @@ static bool CheckConstexprFunctionBody(Sema &SemaRef, const FunctionDecl *Dcl, return true; } +static bool +checkUnionConstructorIntializer(Sema &SemaRef, const FunctionDecl *Dcl, +const CXXConstructorDecl *Constructor,

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

2024-02-20 Thread Shafik Yaghmour via cfe-commits
@@ -2471,6 +2480,23 @@ static bool CheckConstexprFunctionBody(Sema &SemaRef, const FunctionDecl *Dcl, return true; } +static bool +checkUnionConstructorIntializer(Sema &SemaRef, const FunctionDecl *Dcl, shafik wrote: I really don't like this name, I don't

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

2024-02-20 Thread Shafik Yaghmour via cfe-commits
@@ -2393,6 +2391,17 @@ static bool CheckConstexprFunctionBody(Sema &SemaRef, const FunctionDecl *Dcl, Kind)) return false; } +} else if (!Constructor->isDelegatingConstructor()) { shafik wrote:

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

2024-02-20 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-20 Thread Shafik Yaghmour via cfe-commits
@@ -9442,9 +9442,21 @@ bool SpecialMemberDeletionInfo::shouldDeleteForSubobjectCall( int DiagKind = -1; - if (SMOR.getKind() == Sema::SpecialMemberOverloadResult::NoMemberOrDeleted) -DiagKind = !Decl ? 0 : 1; - else if (SMOR.getKind() == Sema::SpecialMemberOverloadRe

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

2024-02-20 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik created https://github.com/llvm/llvm-project/pull/82407 In 765d8a192180f8f33618087b15c022fe758044af we impelemented a fix for incorrect deletion of default constructors in unions. This fix missed a case and so this PR will extend the fix to cover the additional case.

[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-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] [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
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] [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] [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] 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
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] 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] [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] [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
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
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][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][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] 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] Fix regression due to missing ambiguity check before attempting access check. (PR #80730)

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

[clang] [Clang][Sema] Fix regression due to missing ambiguity check before attempting access check. (PR #80730)

2024-02-05 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/80730 >From 80f7b2004a9ae980f8d652e870080a8ff53e3664 Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Mon, 5 Feb 2024 11:08:25 -0800 Subject: [PATCH] [Clang][Sema] Fix regression due to missing ambiguity check befo

[clang] [Clang][Sema] Fix regression due to missing ambiguity check before attempting access check. (PR #80730)

2024-02-05 Thread Shafik Yaghmour via cfe-commits
@@ -201,6 +201,8 @@ Bug Fixes to C++ Support parameter where we did an incorrect specialization of the initialization of the default parameter. Fixes (`#68490 `_) +- Fix regression due missing ambiguity check before check

[clang] [Clang][Sema] Fix regression due to missing ambiguity check before attempting access check. (PR #80730)

2024-02-05 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/80730 >From 1795bc031b9f5367e3bb61e8420278668964c416 Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Mon, 5 Feb 2024 11:08:25 -0800 Subject: [PATCH] [Clang][Sema] Fix regression due to missing ambiguity check befo

[clang] [Clang][Sema] Fix regression due to missing ambiguity check before attempting access check. (PR #80730)

2024-02-05 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik created https://github.com/llvm/llvm-project/pull/80730 Previously when fixing ambiguous lookup diagnostics in cc1b6668c57170cd440d321037ced89d6a61a9cb The change refactored `LookupResult` to split out diagnosing access and ambiguous lookups. The call to `getSema().C

[clang] [Clang][Sema] Fix crash with const qualified member operator new (PR #80327)

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

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

2024-02-02 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Also in the issue: https://github.com/llvm/llvm-project/issues/80510 you pointed out a crash bug. We should have the bug covered in the test case as well. https://github.com/llvm/llvm-project/pull/80519 ___ cfe-co

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

2024-02-02 Thread Shafik Yaghmour via cfe-commits
@@ -108,3 +109,22 @@ int computed_with_lambda = [] { return result; }(); #endif + +#if __cplusplus >= 201703L +namespace DynamicFileScopeLiteral { +// This covers the case where we have a file-scope compound literal with a +// non-constant initializer in C++. Previously, we h

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

2024-02-02 Thread Shafik Yaghmour via cfe-commits
@@ -3342,6 +3342,18 @@ bool Expr::isConstantInitializer(ASTContext &Ctx, bool IsForRef, if (ILE->getType()->isRecordType()) { unsigned ElementNo = 0; RecordDecl *RD = ILE->getType()->castAs()->getDecl(); + + // Check bases for C++17 aggregate initializers.

[clang] [Clang][Sema] Fix crash with const qualified member operator new (PR #80327)

2024-02-02 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/80327 >From b04701226cf9d867b64266a93bf13599b84494ba Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Thu, 1 Feb 2024 11:19:14 -0800 Subject: [PATCH] [Clang][Sema] Fix crash with const qualified member operator new

[clang] [Clang][Sema] Fix crash with const qualified member operator new (PR #80327)

2024-02-02 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/80327 >From 154465e0a81b96daaf71f2c0cf23c39e6f9a8d75 Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Thu, 1 Feb 2024 11:19:14 -0800 Subject: [PATCH] [Clang][Sema] Fix crash with const qualified member operator new

[clang] [Clang][Sema] Fix crash with const qualified member operator new (PR #80327)

2024-02-01 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/80327 >From afcf464812bdb0a167023e7930b0be2ed29a3b3e Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Thu, 1 Feb 2024 11:19:14 -0800 Subject: [PATCH] [Clang][Sema] Fix crash with const qualified member operator new

[clang] [Clang][Sema] Fix crash with const qualified member operator new (PR #80327)

2024-02-01 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik created https://github.com/llvm/llvm-project/pull/80327 We should diagnose a const qualified member operator new but we fail to do so and this leads to crash during debug info generation. The fix is to diagnose this as ill-formed in the front-end. Fixes: https://gith

[clang] [clang] Add tests for DRs about inheriting constructors (PR #79981)

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

[clang] [clang] Accept lambdas in C++03 as an extensions (PR #73376)

2024-01-31 Thread Shafik Yaghmour via cfe-commits
shafik wrote: This LGTM but we need @llvm-beanz to review https://github.com/llvm/llvm-project/pull/73376 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix crash when declaring invalid lambda member (PR #74110)

2024-01-31 Thread Shafik Yaghmour via cfe-commits
@@ -1526,10 +1526,9 @@ bool CXXRecordDecl::isGenericLambda() const { #ifndef NDEBUG static bool allLookupResultsAreTheSame(const DeclContext::lookup_result &R) { - for (auto *D : R) -if (!declaresSameEntity(D, R.front())) - return false; - return true; + return llv

[clang] [clang][ASTImporter] Improve import of variable template specializations. (PR #78284)

2024-01-31 Thread Shafik Yaghmour via cfe-commits
=?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: @@ -6397,116 +6400,132 @@ ExpectedDecl ASTNodeImporter::VisitVarTemplateSpecializationDecl( // Try to find an existing specialization with these template arguments. void *InsertPos = nullptr; - VarTemplateSpecialization

[clang] [clang][ASTImporter] Improve import of variable template specializations. (PR #78284)

2024-01-31 Thread Shafik Yaghmour via cfe-commits
=?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: @@ -6397,116 +6400,132 @@ ExpectedDecl ASTNodeImporter::VisitVarTemplateSpecializationDecl( // Try to find an existing specialization with these template arguments. void *InsertPos = nullptr; - VarTemplateSpecialization

[clang] [clang] Accept lambdas in C++03 as an extensions (PR #73376)

2024-01-31 Thread Shafik Yaghmour via cfe-commits
@@ -58,16 +58,10 @@ class Class2 : public Class1 { #pragma omp declare reduction(fun1 : long : omp_out += omp_in) initializer // expected-error {{expected '(' after 'initializer'}} #pragma omp declare reduction(fun2 : long : omp_out += omp_in) initi

[clang] [clang] Accept lambdas in C++03 as an extensions (PR #73376)

2024-01-31 Thread Shafik Yaghmour via cfe-commits
@@ -1455,39 +1455,44 @@ More information could be found `here Language Extensions Back-ported to Previous Standards = -== ===

[clang] [clang] Accept lambdas in C++03 as an extensions (PR #73376)

2024-01-31 Thread Shafik Yaghmour via cfe-commits
@@ -1526,10 +1526,9 @@ bool CXXRecordDecl::isGenericLambda() const { #ifndef NDEBUG static bool allLookupResultsAreTheSame(const DeclContext::lookup_result &R) { - for (auto *D : R) -if (!declaresSameEntity(D, R.front())) - return false; - return true; + return llv

[clang] [Clang][Sema] Fix crash when type used in return statement contains errors (PR #79788)

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

[clang] [Clang][Sema] Fix crash when type used in return statement contains errors (PR #79788)

2024-01-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/79788 >From f7f1007954503d013294c2e21ce2160dc7866164 Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Sun, 28 Jan 2024 22:42:53 -0800 Subject: [PATCH] [Clang][Sema] Fix crash when type used in return statement cont

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-01-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: In order to aid the discussion on the temporary flag, I think it would be helpful to have a full set of tests that show what elements won't work right with the current set of changes. I think this will help us gauge how impactful partial support would be an

[clang] [Clang][Sema] Fix crash when type used in return statement contains errors (PR #79788)

2024-01-29 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/79788 >From dde16b48d563b3e279872081bad148614e9d28a3 Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Sun, 28 Jan 2024 22:42:53 -0800 Subject: [PATCH] [Clang][Sema] Fix crash when type used in return statement cont

[clang] [Clang][Sema] Fix crash when type used in return statement contains errors (PR #79788)

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

[clang] [Clang][Sema] Fix crash when type used in return statement contains errors (PR #79788)

2024-01-28 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik created https://github.com/llvm/llvm-project/pull/79788 In Sema in `BuildReturnStmt(...)` when we try to determine is the type is move eligable or copy elidable we don't currently check of the init of the `VarDecl` contain errors or not. This can lead to a crash since

[clang] [Clang][Sema] fix outline member function template with default align crash (PR #78400)

2024-01-26 Thread Shafik Yaghmour via cfe-commits
@@ -3061,11 +3062,19 @@ bool Sema::SubstDefaultArgument( /*ForDefinition*/ false); if (addInstantiatedParametersToScope(FD, PatternFD, *LIS, TemplateArgs)) return true; + if (FD->isOutOfLine()) { +TemplateArgumentList *CurrentTemplateArgumen

[clang] [Clang][Sema] fix outline member function template with default align crash (PR #78400)

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

[clang] [Clang][Sema] fix outline member function template with default align crash (PR #78400)

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

[clang] Extend life of variables in `DiagComparison` in `ExprConstant` (PR #79522)

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

[clang] Extend life of variables in `DiagComparison` in `ExprConstant` (PR #79522)

2024-01-26 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I believe the problem is that `DiagComparison` is capturing the locals `LHSValue` and `RHSValue` the lambda is being returned, the local are not longer in lifetime but we are calling `toString` on them. Maybe there is some SSO going on here that changes wh

[clang] [Sema] Fix c23 not checking CheckBoolLikeConversion (PR #79588)

2024-01-26 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thank you for the Fix! Your summary should be a description of the problem and how your solution fixes that problem. You should also link to the github issue in the summary. Questions about the changes in the PR should go as a comment to the PR. Please add

[llvm] [libcxxabi] [flang] [libc] [compiler-rt] [openmp] [lld] [clang] [libunwind] [mlir] [lldb] [libcxx] [clang-tools-extra] [clang] static operators should evaluate object argument (PR #68485)

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

[llvm] [flang] [libcxxabi] [libc] [compiler-rt] [openmp] [mlir] [clang] [libcxx] [clang-tools-extra] [clang] Avoid -Wshadow warning when init-capture named same as class field (PR #74512)

2024-01-25 Thread Shafik Yaghmour via cfe-commits
@@ -8395,10 +8395,11 @@ void Sema::CheckShadow(NamedDecl *D, NamedDecl *ShadowedDecl, unsigned WarningDiag = diag::warn_decl_shadow; SourceLocation CaptureLoc; - if (isa(D) && isa(ShadowedDecl) && NewDC && - isa(NewDC)) { + if (isa(D) && NewDC && isa(NewDC)) {

[clang] [clang][Parser] Fix crash of clang when trying to convert a cast to a nullptr casted to an array of non-constant size to a reference (#78841). (PR #78889)

2024-01-22 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thank you for the patch. This needs a release note and a set of test cases. https://github.com/llvm/llvm-project/pull/78889 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[llvm] [clang] [clang-tools-extra] [clang] Implement CWG1878 "`operator auto` template" (PR #78103)

2024-01-20 Thread Shafik Yaghmour via cfe-commits
@@ -11321,9 +11321,20 @@ Decl *Sema::ActOnConversionDeclarator(CXXConversionDecl *Conversion) { << ClassType << ConvType; } - if (FunctionTemplateDecl *ConversionTemplate -= Conversion->getDescribedFunctionTemplate()) + if (FunctionTe

[clang] [Clang] Implement P2718R0 "Lifetime extension in range-based for loops" (PR #76361)

2024-01-17 Thread Shafik Yaghmour via cfe-commits
@@ -238,3 +239,236 @@ void init_capture_init_list() { // CHECK: call {{.*}}dtor // CHECK: } } + +namespace P2718R0 { shafik wrote: Is it possible to also test the case where it does not clean up like in the proposal: ```cpp for (auto e : f2(g())) {} //

[clang] [Clang] Implement P2718R0 "Lifetime extension in range-based for loops" (PR #76361)

2024-01-17 Thread Shafik Yaghmour via cfe-commits
@@ -2312,12 +2312,31 @@ Parser::DeclGroupPtrTy Parser::ParseDeclGroup(ParsingDeclSpec &DS, bool IsForRangeLoop = false; if (TryConsumeToken(tok::colon, FRI->ColonLoc)) { IsForRangeLoop = true; + EnterExpressionEvaluationContext ForRangeInitContext( +

[clang] [clang] Fix assertion failure with deleted overloaded unary operators (PR #78316)

2024-01-16 Thread Shafik Yaghmour via cfe-commits
@@ -14310,8 +14310,8 @@ Sema::CreateOverloadedUnaryOp(SourceLocation OpLoc, UnaryOperatorKind Opc, PartialDiagnosticAt(OpLoc, PDiag(diag::err_ovl_deleted_oper) << UnaryOperator::getOpcodeStr(Opc)

[clang] [clang] Fix CTAD not work for function-type and array-type arguments. (PR #78159)

2024-01-16 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > > Can you please provide a more detailed summary, since these are usually > > what goes in the git log. It should describe the cause and the approach of > > the fix. It is also helpful for reviewers as well. > > Done, added details in the description. Thank you! Much appreciat

[clang] [clang] Fix CTAD not work for function-type and array-type arguments. (PR #78159)

2024-01-15 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. LGTM after more detailed summary provided. https://github.com/llvm/llvm-project/pull/78159 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[clang] [clang] Fix CTAD not work for function-type and array-type arguments. (PR #78159)

2024-01-15 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Can you please provide a more detailed summary, since these are usually what goes in the git log. It should describe the cause and the approach of the fix. It is also helpful for reviewers as well. https://github.com/llvm/llvm-project/pull/78159 __

[clang] [clang] Fix direct-initialization with new expressions for arrays (PR #78201)

2024-01-15 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: I believe the approach here is not sufficient and we have a current PR in progress: https://github.com/llvm/llvm-project/pull/76976 we also need codegen work to implement this. https://github.com/llvm/llvm-project/pull/78201

[clang] [Clang] Implement CWG2598: Union of non-literal types (PR #78195)

2024-01-15 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Mostly looks good but I would like a second set of eyes. https://github.com/llvm/llvm-project/pull/78195 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang] [Clang] Implement CWG2598: Union of non-literal types (PR #78195)

2024-01-15 Thread Shafik Yaghmour via cfe-commits
@@ -208,3 +208,54 @@ namespace dr2565 { // dr2565: 16 open #endif } + + +namespace dr2598 { // dr2598: 18 +#if __cplusplus >= 201103L +struct NonLiteral { +NonLiteral(); +}; + +struct anonymous1 { +union {} a; +}; +static_assert(__is_literal(anonymous1), ""); + +struct

[clang] [Clang] Implement CWG2598: Union of non-literal types (PR #78195)

2024-01-15 Thread Shafik Yaghmour via cfe-commits
@@ -208,3 +208,54 @@ namespace dr2565 { // dr2565: 16 open #endif } + + +namespace dr2598 { // dr2598: 18 +#if __cplusplus >= 201103L +struct NonLiteral { +NonLiteral(); +}; + +struct anonymous1 { +union {} a; +}; +static_assert(__is_literal(anonymous1), ""); + +struct

[clang] [Clang] Implement CWG2598: Union of non-literal types (PR #78195)

2024-01-15 Thread Shafik Yaghmour via cfe-commits
@@ -208,3 +208,54 @@ namespace dr2565 { // dr2565: 16 open #endif } + + +namespace dr2598 { // dr2598: 18 +#if __cplusplus >= 201103L +struct NonLiteral { +NonLiteral(); +}; + +struct anonymous1 { +union {} a; +}; +static_assert(__is_literal(anonymous1), ""); + +struct

[clang] [Clang] Implement CWG2598: Union of non-literal types (PR #78195)

2024-01-15 Thread Shafik Yaghmour via cfe-commits
@@ -1383,6 +1383,34 @@ void CXXRecordDecl::addedMember(Decl *D) { } } +bool CXXRecordDecl::isLiteral() const { + const LangOptions &LangOpts = getLangOpts(); + if (!(LangOpts.CPlusPlus20 ? hasConstexprDestructor() + : hasTrivialDestructor())) +

[clang] [Clang] Implement CWG2598: Union of non-literal types (PR #78195)

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

[clang] [Clang] Implement CWG2598: Union of non-literal types (PR #78195)

2024-01-15 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Is this a potentially breaking change since we have expanded what types are considered literals and already existing code may observe this fix? https://github.com/llvm/llvm-project/pull/78195 ___ cfe-commits mailin

[libcxx] [libunwind] [libc] [flang] [lld] [lldb] [compiler-rt] [llvm] [clang-tools-extra] [clang] [libclc] [clang] Add tests for DRs about complete-class context (PR #77444)

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

[clang] [clang] Add test for CWG1350 (PR #78040)

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

[flang] [clang] [lld] [mlir] [compiler-rt] [libcxxabi] [libcxx] [clang-tools-extra] [lldb] [libunwind] [libc] [llvm] [openmp] [clang] static operators should evaluate object argument (PR #68485)

2024-01-11 Thread Shafik Yaghmour via cfe-commits
@@ -5678,10 +5678,15 @@ static ImplicitConversionSequence TryObjectArgumentInitialization( assert(FromType->isRecordType()); QualType ClassType = S.Context.getTypeDeclType(ActingContext); - // [class.dtor]p2: A destructor can be invoked for a const, volatile or - //

[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] 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][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] [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] 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] [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] 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] 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] 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] Correctly construct template arguments for file-scope template template parameters (PR #76811)

2024-01-03 Thread Shafik Yaghmour via cfe-commits
@@ -345,15 +345,19 @@ MultiLevelTemplateArgumentList Sema::getTemplateInstantiationArgs( using namespace TemplateInstArgsHelpers; const Decl *CurDecl = ND; + + if (!ND) shafik wrote: Seems less error prone to check `!CurDecl` here. If the surrounding co

[clang] [Clang] Correctly construct template arguments for file-scope template template parameters (PR #76811)

2024-01-03 Thread Shafik Yaghmour via cfe-commits
@@ -345,15 +345,19 @@ MultiLevelTemplateArgumentList Sema::getTemplateInstantiationArgs( using namespace TemplateInstArgsHelpers; const Decl *CurDecl = ND; + + if (!ND) shafik wrote: Can we also get a comment here why this makes sense to call `Decl::ca

<    1   2   3   4   5   6   7   8   >