[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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[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
@@ -0,0 +1,15 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +template < class T, class V > struct A +{ +A (); +A (A &); +A (A < V,T >); +// expected-error@-1 {{copy constructor must pass its first argument by reference}} +}; + +void f () +{ +A (A < int,

[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

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

[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

[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

[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

[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 , const FunctionDecl *Dcl, return true; } +static bool +checkUnionConstructorIntializer(Sema , 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 , 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

[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 , const FunctionDecl *Dcl, return true; } +static bool +checkUnionConstructorIntializer(Sema , 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 , const FunctionDecl *Dcl, return true; } +static bool +checkUnionConstructorIntializer(Sema , const FunctionDecl *Dcl, shafik wrote: I really don't like this name, I don't feel like it

[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 , const FunctionDecl *Dcl, Kind)) return false; } +} else if (!Constructor->isDelegatingConstructor()) { shafik wrote: Can

[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

[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() ==

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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

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

[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

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

[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

[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

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

[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 ) { - for (auto *D : R) -if (!declaresSameEntity(D, R.front())) - return false; - return true; + return

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

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

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

[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 ) { - for (auto *D : R) -if (!declaresSameEntity(D, R.front())) - return false; - return true; + return

[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

[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

[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

[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

[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

[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

<    1   2   3   4   5   6   >