[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

[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] [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 https://lists.llvm.org/cgi-bin/mailman/listinfo/

[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) + i

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

[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)) {

[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

[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

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

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

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

[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
@@ -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
@@ -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
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] 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] 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 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-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 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] 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] 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())) {} //

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

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

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

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

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

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

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

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

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

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

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

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

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

[clang] [clang] Enable Wenum-constexpr-conversion also in system headers and … (PR #67528)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
Carlos =?utf-8?q?G=C3=A1lvez?= Message-ID: In-Reply-To: shafik wrote: Thank you for doing this work. https://github.com/llvm/llvm-project/pull/67528 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] [clang] Handle templated operators with reversed arguments (PR #69595)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
@@ -7688,7 +7688,7 @@ bool Sema::CheckNonDependentConversions( QualType ParamType = ParamTypes[I + Offset]; if (!ParamType->isDependentType()) { unsigned ConvIdx = PO == OverloadCandidateParamOrder::Reversed - ? 0 +

[clang] Remove warnings from -Wchar-subscripts for known positive constants (PR #69061)

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

[clang] Remove warnings from -Wchar-subscripts for known positive constants (PR #69061)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: You need to make sure you tests have newlines at the end https://github.com/llvm/llvm-project/pull/69061 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang] Remove warnings from -Wchar-subscripts for known positive constants (PR #69061)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,103 @@ +// RUN: %clang_cc1 -Wchar-subscripts -fsyntax-only -verify %s + +void t1(void) { + int array[1] = { 0 }; + char subscript = 0; + int val = array[subscript]; // expected-warning{{array subscript is of type 'char'}} +} + +void t2(void) { + int array[1] = { 0

[clang] [Clang] Fix dependence handling of nttp for variable templates (PR #69075)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
=?utf-8?b?5YiY6Zuo5Z+5?= Message-ID: In-Reply-To: https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/69075 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix dependence handling of nttp for variable templates (PR #69075)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
=?utf-8?b?5YiY6Zuo5Z+5?= Message-ID: In-Reply-To: https://github.com/shafik commented: A couple of nitpicks https://github.com/llvm/llvm-project/pull/69075 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [Clang] Fix dependence handling of nttp for variable templates (PR #69075)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
=?utf-8?b?5YiY6Zuo5Z+5?= Message-ID: In-Reply-To: @@ -354,10 +354,10 @@ UnresolvedLookupExpr::UnresolvedLookupExpr( NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, bool RequiresADL, bool Overloaded, const Te

[clang] [Clang] Fix dependence handling of nttp for variable templates (PR #69075)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
=?utf-8?b?5YiY6Zuo5Z+5?= Message-ID: In-Reply-To: @@ -1299,8 +1299,9 @@ static bool checkTupleLikeDecomposition(Sema &S, // in the associated namespaces. Expr *Get = UnresolvedLookupExpr::Create( S.Context, nullptr, NestedNameSpecifierLoc(), SourceLoc

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

2023-10-25 Thread Shafik Yaghmour via cfe-commits
@@ -15604,10 +15604,13 @@ bool Expr::EvaluateAsInitializer(APValue &Value, const ASTContext &Ctx, LValue LVal; LVal.set(VD); -if (!EvaluateInPlace(Value, Info, LVal, this, - /*AllowNonLiteralTypes=*/true) || -EStatus.HasSideEffects)

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

2023-10-25 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Please make sure you write a more complete description of the problem and why this solves the problem. The description is usually what goes into the git log and that is very useful for quickly understanding commits and tracking down problems. I know some folks edit the descript

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

2023-10-25 Thread Shafik Yaghmour via cfe-commits
shafik wrote: I think this change makes sense but I am not crazy about how we deal w/ full-expressions right now with these `FullExpressionRAII`, it feels very ad-hoc and it takes a bunch of time to understand why they are needed where they are. https://github.com/llvm/llvm-project/pull/69076

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

2023-10-25 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > While the change itself looks neat, I am curious about the reason how this > interact with modules. IIUC modules is incidental to the problem, it is just a way we run into an underlying issue that we are not dealing with full-expressions properly in this case. https://github.

[clang] [Clang][Sema] Skip RecordDecl when checking scope of declarations (PR #69432)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
@@ -19,4 +19,8 @@ void f2(void) { struct U u; } - +void f3(void) { shafik wrote: So unlike the original test case this one does not seem to cause a crash. Can we add a test case for that as well to verify we are fixing that issue as well. https://github.c

[clang] [clang] Bail out if the result of function template instantiation is not a function type. (PR #69459)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Please next time add a detailed description to your PR. This is key for reviewers to fully understand at a glance what the fix is for. This is also key for users of git log to be able to understand changes at a glance without having to dig in. Folks often use git log to track dow

[clang] [clang] Bail out if the result of function template instantiation is not a function type. (PR #69459)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -x c++ -std=c++14 -fsyntax-only -verify %s + +template +using Type = typename A::NestedType; // expected-error {{type 'float' cannot be used prior to '::' because it has no members}} + +template +void Func() { + using MyType = Type(); // ex

[clang] [clang] Language to String function (PR #69487)

2023-10-25 Thread Shafik Yaghmour via cfe-commits
shafik wrote: What is the intended use for this? https://github.com/llvm/llvm-project/pull/69487 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Mark declarators invalid in the presence of ill-formed explicit parameters. (PR #70018)

2023-10-26 Thread Shafik Yaghmour via cfe-commits
@@ -542,3 +542,46 @@ void foo(C c) { } } + + +namespace GH69838 { +struct S { + S(this auto &self) {} // expected-error {{an explicit object parameter cannot appear in a constructor}} + virtual void f(this S self) {} // expected-error {{an explicit object parameter cannot

[clang] [Clang] Diagnose defaulted assignment operator with incompatible object parameter (PR #70176)

2023-10-27 Thread Shafik Yaghmour via cfe-commits
@@ -585,3 +585,34 @@ class Server : public Thing { S name_; }; } + +namespace GH69233 { +struct Base {}; +struct S : Base { +int j; +S& operator=(this Base& self, const S&) = default; +// expected-warning@-1 {{explicitly defaulted copy assignment operator is im

r370107 - Debug Info: Support for DW_AT_export_symbols for anonymous structs

2019-08-27 Thread Shafik Yaghmour via cfe-commits
Author: shafik Date: Tue Aug 27 13:17:35 2019 New Revision: 370107 URL: http://llvm.org/viewvc/llvm-project?rev=370107&view=rev Log: Debug Info: Support for DW_AT_export_symbols for anonymous structs This implements the DWARF 5 feature described in: http://dwarfstd.org/ShowIssue.php?issue=141212

[clang] 2608f55 - [Clang] Tighten restrictions on enum out of range diagnostic

2022-08-11 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2022-08-11T13:44:26-07:00 New Revision: 2608f553b8fd02bfd5a81d9e45406cee0c2dfe26 URL: https://github.com/llvm/llvm-project/commit/2608f553b8fd02bfd5a81d9e45406cee0c2dfe26 DIFF: https://github.com/llvm/llvm-project/commit/2608f553b8fd02bfd5a81d9e45406cee0c2dfe26.dif

[clang] 1067745 - [Clang] Fix for Tighten restrictions on enum out of range diagnostic

2022-08-11 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2022-08-11T15:34:58-07:00 New Revision: 106774515b77d55edeab6e80555c410efc1f586a URL: https://github.com/llvm/llvm-project/commit/106774515b77d55edeab6e80555c410efc1f586a DIFF: https://github.com/llvm/llvm-project/commit/106774515b77d55edeab6e80555c410efc1f586a.dif

[clang] 8de5137 - [Clang] Tighten restrictions on enum out of range diagnostic to avoid constant initialization

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

[clang] 21dfe48 - [Clang] Fix assert in Sema::LookupTemplateName so that it does not attempt an unconditional cast to TagType

2022-08-26 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2022-08-26T09:40:43-07:00 New Revision: 21dfe482e13e3b64801372f8b3db75eeb85b3135 URL: https://github.com/llvm/llvm-project/commit/21dfe482e13e3b64801372f8b3db75eeb85b3135 DIFF: https://github.com/llvm/llvm-project/commit/21dfe482e13e3b64801372f8b3db75eeb85b3135.dif

[clang] f8a37a6 - [Clang] Fix compat diagnostic to detect a nontype template parameter has a placeholder type using getContainedAutoType()

2022-09-18 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2022-09-18T11:54:32-07:00 New Revision: f8a37a6ce67470f9f6b3a4dacb65c637c2958b8d URL: https://github.com/llvm/llvm-project/commit/f8a37a6ce67470f9f6b3a4dacb65c637c2958b8d DIFF: https://github.com/llvm/llvm-project/commit/f8a37a6ce67470f9f6b3a4dacb65c637c2958b8d.dif

[clang] 475cc44 - [Clang] Modify sanity check assert in AggExprEmitter::VisitInitListExpr to cover anonymous struct in a union GNU extension

2022-12-21 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2022-12-21T10:50:05-08:00 New Revision: 475cc44a2cba45c5449a323c6b331ddc593bd8de URL: https://github.com/llvm/llvm-project/commit/475cc44a2cba45c5449a323c6b331ddc593bd8de DIFF: https://github.com/llvm/llvm-project/commit/475cc44a2cba45c5449a323c6b331ddc593bd8de.dif

[clang] 9332ddf - [Clang] Extend the number of case Sema::CheckForIntOverflow covers

2022-11-15 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2022-11-15T12:07:03-08:00 New Revision: 9332ddfba69c38f9ceef4175b042fba0bb8e67bb URL: https://github.com/llvm/llvm-project/commit/9332ddfba69c38f9ceef4175b042fba0bb8e67bb DIFF: https://github.com/llvm/llvm-project/commit/9332ddfba69c38f9ceef4175b042fba0bb8e67bb.dif

[clang] 6ec446d - [Clang] Add sanity check in Sema::getDestructorName to prevent nullptr dereference

2023-01-25 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2023-01-25T10:49:04-08:00 New Revision: 6ec446ddcee33777a8420c227374f7b422a7df1b URL: https://github.com/llvm/llvm-project/commit/6ec446ddcee33777a8420c227374f7b422a7df1b DIFF: https://github.com/llvm/llvm-project/commit/6ec446ddcee33777a8420c227374f7b422a7df1b.dif

[clang] 2bd8aee - [Clang] Fix unconditional access to Attr pointer when checking if _Nullable is applicable to a type

2023-01-30 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2023-01-30T13:28:29-08:00 New Revision: 2bd8aeea7e7d885fbf6c70c0e181b1e8e6b808a5 URL: https://github.com/llvm/llvm-project/commit/2bd8aeea7e7d885fbf6c70c0e181b1e8e6b808a5 DIFF: https://github.com/llvm/llvm-project/commit/2bd8aeea7e7d885fbf6c70c0e181b1e8e6b808a5.dif

[clang] 67ee18c - [Clang] Add machinery to catch overflow in unary minus outside of a constant expression context

2023-01-31 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2023-01-31T09:35:12-08:00 New Revision: 67ee18cc7a308ae8418689c4f03a1be73b8b874a URL: https://github.com/llvm/llvm-project/commit/67ee18cc7a308ae8418689c4f03a1be73b8b874a DIFF: https://github.com/llvm/llvm-project/commit/67ee18cc7a308ae8418689c4f03a1be73b8b874a.dif

[clang] a013839 - [Clang] Diagnose undefined behavior in a constant expression while evaluating a compound assignment with remainder as operand

2023-01-12 Thread Shafik Yaghmour via cfe-commits
Author: Shafik Yaghmour Date: 2023-01-12T08:04:04-08:00 New Revision: a0138390dd2ac2130c9f76e6778d6e45e4dc5526 URL: https://github.com/llvm/llvm-project/commit/a0138390dd2ac2130c9f76e6778d6e45e4dc5526 DIFF: https://github.com/llvm/llvm-project/commit/a0138390dd2ac2130c9f76e6778d6e45e4dc5526.dif

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

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

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

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

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