[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 21 06:34:43 PST 2025
================
@@ -0,0 +1,272 @@
+// RUN: %clang_cc1 -std=c++2c -verify %s
+
+class Trivial {};
+struct NonRelocatable {
+ ~NonRelocatable();
+};
+static NonRelocatable NonRelocatable_g;
+
+class A trivially_relocatable_if_eligible {};
+class B trivially_relocatable_if_eligible : Trivial{};
+class C trivially_relocatable_if_eligible {
+ int a;
+ void* b;
+ int c[3];
+ Trivial d[3];
+ NonRelocatable& e = NonRelocatable_g;
----------------
Sirraide wrote:
Maybe add some `const`/`volatile` members too.
https://github.com/llvm/llvm-project/pull/127636
More information about the cfe-commits
mailing list