[clang] [Clang] Partial implementation of support for P3074 (trivial unions) (PR #146815)

2025-07-09 Thread Barry Revzin via cfe-commits
@@ -0,0 +1,69 @@ +// RUN: %clang_cc1 -verify -std=c++26 %s -Wno-defaulted-function-deleted -triple x86_64-linux-gnu + +struct NonTrivial { brevzin wrote: Done. https://github.com/llvm/llvm-project/pull/146815 ___ cfe-

[clang] [Clang] Partial implementation of support for P3074 (trivial unions) (PR #146815)

2025-07-09 Thread Barry Revzin via cfe-commits
https://github.com/brevzin updated https://github.com/llvm/llvm-project/pull/146815 >From 40290a957b6f349a9b670193c8bc699d8eb7d373 Mon Sep 17 00:00:00 2001 From: Barry Revzin Date: Fri, 27 Jun 2025 17:29:45 -0500 Subject: [PATCH 01/10] [P3074] Implementing part of trivial unions --- clang/lib

[clang] [Clang] Partial implementation of support for P3074 (trivial unions) (PR #146815)

2025-07-07 Thread Barry Revzin via cfe-commits
@@ -9543,6 +9543,48 @@ bool SpecialMemberDeletionInfo::shouldDeleteForSubobjectCall( if (DiagKind == -1) return false; + if (this->S.Context.getLangOpts().CPlusPlus26 && inUnion() && + CSM == CXXSpecialMemberKind::Destructor) { +// [class.dtor]/7 In C++26, a d

[clang] [Clang] Partial implementation of support for P3074 (trivial unions) (PR #146815)

2025-07-07 Thread Barry Revzin via cfe-commits
https://github.com/brevzin edited https://github.com/llvm/llvm-project/pull/146815 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [P3074] Partial implementation of support for trivial unions (PR #146815)

2025-07-03 Thread Barry Revzin via cfe-commits
https://github.com/brevzin updated https://github.com/llvm/llvm-project/pull/146815 >From 40290a957b6f349a9b670193c8bc699d8eb7d373 Mon Sep 17 00:00:00 2001 From: Barry Revzin Date: Fri, 27 Jun 2025 17:29:45 -0500 Subject: [PATCH 1/9] [P3074] Implementing part of trivial unions --- clang/lib/A

[clang] [P3074] Partial implementation of support for trivial unions (PR #146815)

2025-07-03 Thread Barry Revzin via cfe-commits
https://github.com/brevzin updated https://github.com/llvm/llvm-project/pull/146815 >From 40290a957b6f349a9b670193c8bc699d8eb7d373 Mon Sep 17 00:00:00 2001 From: Barry Revzin Date: Fri, 27 Jun 2025 17:29:45 -0500 Subject: [PATCH 1/8] [P3074] Implementing part of trivial unions --- clang/lib/A

[clang] [P3074] Partial implementation of support for trivial unions (PR #146815)

2025-07-03 Thread Barry Revzin via cfe-commits
https://github.com/brevzin updated https://github.com/llvm/llvm-project/pull/146815 >From 40290a957b6f349a9b670193c8bc699d8eb7d373 Mon Sep 17 00:00:00 2001 From: Barry Revzin Date: Fri, 27 Jun 2025 17:29:45 -0500 Subject: [PATCH 1/7] [P3074] Implementing part of trivial unions --- clang/lib/A

[clang] [P3074] Partial implementation of support for trivial unions (PR #146815)

2025-07-03 Thread Barry Revzin via cfe-commits
https://github.com/brevzin updated https://github.com/llvm/llvm-project/pull/146815 >From 40290a957b6f349a9b670193c8bc699d8eb7d373 Mon Sep 17 00:00:00 2001 From: Barry Revzin Date: Fri, 27 Jun 2025 17:29:45 -0500 Subject: [PATCH 1/6] [P3074] Implementing part of trivial unions --- clang/lib/A

[clang] [P3074] Partial implementation of support for trivial unions (PR #146815)

2025-07-03 Thread Barry Revzin via cfe-commits
@@ -23,8 +24,8 @@ int n; // - X is a union-like class that has a variant member with a non-trivial // default constructor, -union Deleted1a { UserProvidedDefCtor u; }; // expected-note {{default constructor of 'Deleted1a' is implicitly deleted because variant field 'u' has a

[clang] [P3074] Partial implementation of support for trivial unions (PR #146815)

2025-07-03 Thread Barry Revzin via cfe-commits
@@ -922,7 +922,7 @@ namespace cwg667 { // cwg667: 8 struct B { ~B() = delete; }; union C { B b; }; - static_assert(!__is_trivially_destructible(C), ""); + static_assert(!__is_trivially_destructible(C), ""); // cxx26-error {{failed}} brevzin wrote: Done.

[clang] [P3074] Partial implementation of support for trivial unions (PR #146815)

2025-07-03 Thread Barry Revzin via cfe-commits
https://github.com/brevzin updated https://github.com/llvm/llvm-project/pull/146815 >From 40290a957b6f349a9b670193c8bc699d8eb7d373 Mon Sep 17 00:00:00 2001 From: Barry Revzin Date: Fri, 27 Jun 2025 17:29:45 -0500 Subject: [PATCH 1/5] [P3074] Implementing part of trivial unions --- clang/lib/A

[clang] [P3074] Partial implementation of support for trivial unions (PR #146815)

2025-07-02 Thread Barry Revzin via cfe-commits
https://github.com/brevzin updated https://github.com/llvm/llvm-project/pull/146815 >From 40290a957b6f349a9b670193c8bc699d8eb7d373 Mon Sep 17 00:00:00 2001 From: Barry Revzin Date: Fri, 27 Jun 2025 17:29:45 -0500 Subject: [PATCH 1/2] [P3074] Implementing part of trivial unions --- clang/lib/A

[clang] [P3074] Partial implementation of support for trivial unions (PR #146815)

2025-07-02 Thread Barry Revzin via cfe-commits
brevzin wrote: Oh. Actually I didn't quite properly implement the destructor rule, since that changed since I originally implemented this. The new rule is that the default destructor for a union `X` [is deleted if](http://eel.is/c++draft/class.dtor#7.2) * default constructing an `X` either fa

[clang] [P3074] Partial implementation of support for trivial unions (PR #146815)

2025-07-02 Thread Barry Revzin via cfe-commits
https://github.com/brevzin edited https://github.com/llvm/llvm-project/pull/146815 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [P3074] Parital implementation of support for trivial unions (PR #146815)

2025-07-02 Thread Barry Revzin via cfe-commits
https://github.com/brevzin created https://github.com/llvm/llvm-project/pull/146815 This commit makes union construction/destruction trivial by default, but does not add the lifetime aspects of the paper — am holding out until P3726R0 will be discussed which alters that approach somewhat based

[clang] [clang][Sema] Track trivial-relocatability as a type trait (PR #84621)

2024-04-05 Thread Barry Revzin via cfe-commits
@@ -857,8 +881,13 @@ void CXXRecordDecl::addedMember(Decl *D) { data().HasDeclaredCopyAssignmentWithConstParam = true; } -if (Method->isMoveAssignmentOperator()) +if (Method->isMoveAssignmentOperator()) { SMKind |= SMF_MoveAssignment; +} + +i