[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][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] 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][Sema] Fix for enums overflowing (#24667) (PR #78742)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[clang] 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] allow `` `@$ `` in raw string delimiters in C++26 (PR #93216)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[clang] [Clang] Require base element type of `__has_unique_object_representations` to be complete (PR #95432)

2024-06-13 Thread Shafik Yaghmour via cfe-commits
@@ -2791,6 +2791,12 @@ bool ASTContext::hasUniqueObjectRepresentations( return hasUniqueObjectRepresentations(getBaseElementType(Ty), CheckIfTriviallyCopyable); + if (Ty->isVoidType()) shafik wrote: It is not

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-06-13 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik created https://github.com/llvm/llvm-project/pull/95474 P2280R4 allows the use of references in pointers of unknown origins in a constant expression context but only in specific cases that could be constant expressions. We track whether a variable is a constexpr

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-06-14 Thread Shafik Yaghmour via cfe-commits
@@ -3420,6 +3441,15 @@ static bool evaluateVarDeclInit(EvalInfo , const Expr *E, } Result = VD->getEvaluatedValue(); + + // P2280R4 If we don't have a value because this is a reference that was not + // initialized or whose lifetime began within E then create a value

[clang] [clang] Cover CWG issues about `export template` (PR #94876)

2024-06-18 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: LGTM after addressing coloring issues. https://github.com/llvm/llvm-project/pull/94876 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] fix: complete comment (PR #97322)

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

[clang] fix: complete comment (PR #97322)

2024-07-01 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. Thank you for the fix! LGTM https://github.com/llvm/llvm-project/pull/97322 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Reuse tail-padding for more types that are not POD for the purpose of layout (PR #90462)

2024-06-20 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Looks like this is ready to land, if you have reached out to the Fuchsia and XL folks you should be good. https://github.com/llvm/llvm-project/pull/90462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2024-06-20 Thread Shafik Yaghmour via cfe-commits
shafik wrote: Is this ready to land? https://github.com/llvm/llvm-project/pull/90387 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement CWG2877 "Type-only lookup for using-enum-declarator" (PR #95399)

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

[clang] [clang] Implement CWG2877 "Type-only lookup for using-enum-declarator" (PR #95399)

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

[clang] [clang] Implement CWG2877 "Type-only lookup for using-enum-declarator" (PR #95399)

2024-06-20 Thread Shafik Yaghmour via cfe-commits
@@ -241,6 +238,13 @@ TPLa a; } // namespace Thirteen +namespace Fourteen { +template +int A = T(); + +using enum A; // expected-error {{A is not an enumerated type}} +} // namespace Fourteen shafik wrote: What does `Fourteen` stand for here or is it just a

[clang] [clang] Implement CWG2877 "Type-only lookup for using-enum-declarator" (PR #95399)

2024-06-20 Thread Shafik Yaghmour via cfe-commits
@@ -148,13 +148,10 @@ template struct C { enum class D { d, e, f }; - using enum D; - - static constexpr int W = int(f) + I; + using enum D; // expected-error {{using-enum cannot name a dependent type}} shafik wrote: It

[clang] [clang] Allow class with anonymous union member to be const-default-constructible even if a union member has a default member initializer (#95854) (PR #96301)

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

[clang] [clang] Allow class with anonymous union member to be const-default-constructible even if a union member has a default member initializer (#95854) (PR #96301)

2024-06-21 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thank you for this fix. It needs a release note and your summary should have some more details on what the cause of the bug is and how your PR fixes it. efriedma-quic's comment provides a good framework for explaining the cause.

[clang] [clang] Allow class with anonymous union member to be const-default-constructible even if a union member has a default member initializer (#95854) (PR #96301)

2024-06-21 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,11 @@ +// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify %s shafik wrote: I think this may be a more appropriate place for the test: https://github.com/llvm/llvm-project/blob/main/clang/test/SemaCXX/anonymous-union.cpp We usually wrap tests from

[clang] [clang] Allow class with anonymous union member to be const-default-constructible even if a union member has a default member initializer (#95854) (PR #96301)

2024-06-21 Thread Shafik Yaghmour via cfe-commits
@@ -1392,7 +1392,8 @@ class CXXRecordDecl : public RecordDecl { bool allowConstDefaultInit() const { return !data().HasUninitializedFields || !(data().HasDefaultedDefaultConstructor || - needsImplicitDefaultConstructor()); +

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

2024-07-09 Thread Shafik Yaghmour via cfe-commits
shafik wrote: You reapplied this here: https://github.com/llvm/llvm-project/commit/1595988ee6f9732e7ea79928af8a470ad5ef7dbe but it has caused a regression: https://github.com/llvm/llvm-project/issues/97646 https://github.com/llvm/llvm-project/pull/90500

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

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

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-07-09 Thread Shafik Yaghmour via cfe-commits
@@ -249,13 +249,15 @@ class APValue { struct NoLValuePath {}; struct UninitArray {}; struct UninitStruct {}; + struct ConstexprUnknown {}; template friend class clang::serialization::BasicReaderBase; friend class ASTImporter; friend class ASTNodeImporter;

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-07-09 Thread Shafik Yaghmour via cfe-commits
@@ -249,13 +249,15 @@ class APValue { struct NoLValuePath {}; struct UninitArray {}; struct UninitStruct {}; + struct ConstexprUnknown {}; template friend class clang::serialization::BasicReaderBase; friend class ASTImporter; friend class ASTNodeImporter;

[clang] [Clang] Don't crash if input file is not a module. (PR #98439)

2024-07-12 Thread Shafik Yaghmour via cfe-commits
shafik wrote: I don't think the build error is related to this change. https://github.com/llvm/llvm-project/pull/98439 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] fix cast failures by adjusting the resolution of record declaration contexts to handle semantic and lexical distinctions (PR #96228)

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

[clang] [Clang] Don't crash if input file is not a module. (PR #98439)

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

[clang] [libcxx] [llvm] Reapply "[Clang] Implement resolution for CWG1835 (#92957)" (PR #98547)

2024-07-12 Thread Shafik Yaghmour via cfe-commits
shafik wrote: > The sad part is that MSVC and some old versions of GCC don't like `template` > being added here :( It looks like the description provides a workaround for gcc but a bug report against MSVC should be filed if we don' have one already.

[clang] [clang] Prevent dangling StringRefs (PR #98699)

2024-07-12 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik requested changes to this pull request. It looks like we are using the same pattern that fix is using in `ASTStmtReader::VisitRequiresExpr` which gives me some comfort but I am not happy that we have a relatively complex and easy to get wrong operation repeated in

[clang] [Clang] use parent declaration context to avoid asserting cast failure in defaulted comparison method (PR #96228)

2024-06-21 Thread Shafik Yaghmour via cfe-commits
@@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s shafik wrote: I think this is a better location for the test: https://github.com/llvm/llvm-project/blob/main/clang/test/CXX/class/class.compare/class.compare.default/p1.cpp We normally

[clang] [Clang] use parent declaration context to avoid asserting cast failure in defaulted comparison method (PR #96228)

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

[clang] [Clang] use parent declaration context to avoid asserting cast failure in defaulted comparison method (PR #96228)

2024-06-21 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Thank you for the fix. I am curious what specifically about this code triggers the crash. We do have a test w/ a defaulted outside the class. So there is another condition needed to trigger this. It looks like removing `constexpr` from `operator==(d h, g

[clang] [Clang] use parent declaration context to avoid asserting cast failure in defaulted comparison method (PR #96228)

2024-06-21 Thread Shafik Yaghmour via cfe-commits
shafik wrote: There are several test failures that look related to this change, please check them out. https://github.com/llvm/llvm-project/pull/96228 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Implement P2582R1: CTAD from inherited constructors (PR #98788)

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

[clang] [clang] Implement P2582R1: CTAD from inherited constructors (PR #98788)

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

[clang] [clang] Implement P2582R1: CTAD from inherited constructors (PR #98788)

2024-07-13 Thread Shafik Yaghmour via cfe-commits
@@ -2157,17 +2157,19 @@ CXXDeductionGuideDecl *CXXDeductionGuideDecl::Create( ASTContext , DeclContext *DC, SourceLocation StartLoc, ExplicitSpecifier ES, const DeclarationNameInfo , QualType T, TypeSourceInfo *TInfo, SourceLocation EndLocation, CXXConstructorDecl

[clang] [Clang] Refactor uses of `Cand->Function` in SemaOverload.cpp (PR #98965)

2024-07-17 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik requested changes to this pull request. https://github.com/llvm/llvm-project/pull/98965 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Refactor uses of `Cand->Function` in SemaOverload.cpp (PR #98965)

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

[clang] [Clang] Refactor uses of `Cand->Function` in SemaOverload.cpp (PR #98965)

2024-07-17 Thread Shafik Yaghmour via cfe-commits
@@ -11846,19 +11854,21 @@ static void DiagnoseFailedEnableIfAttr(Sema , OverloadCandidate *Cand) { } static void DiagnoseFailedExplicitSpec(Sema , OverloadCandidate *Cand) { - ExplicitSpecifier ES = ExplicitSpecifier::getFromDecl(Cand->Function); + assert(Cand->Function &&

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-07-17 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik updated https://github.com/llvm/llvm-project/pull/95474 >From 69b09ea5b0f0a1c5419c488ade29b6fedc6de773 Mon Sep 17 00:00:00 2001 From: Shafik Yaghmour Date: Thu, 13 Jun 2024 14:20:50 -0700 Subject: [PATCH] [Clang] Implement P2280R4 Using unknown pointers and

[clang] [Clang] Refactor uses of `Cand->Function` in SemaOverload.cpp (PR #98965)

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

[clang] [Clang] Refactor uses of `Cand->Function` in SemaOverload.cpp (PR #98965)

2024-07-17 Thread Shafik Yaghmour via cfe-commits
@@ -11846,19 +11854,21 @@ static void DiagnoseFailedEnableIfAttr(Sema , OverloadCandidate *Cand) { } static void DiagnoseFailedExplicitSpec(Sema , OverloadCandidate *Cand) { - ExplicitSpecifier ES = ExplicitSpecifier::getFromDecl(Cand->Function); + assert(Cand->Function &&

<    1   2   3   4   5   6   7   >