[clang] [Clang] P3074R7: trivial unions & (unadopted) P3726R1: Adjustments to Union Lifetime Rules (PR #185830)

via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 11 01:20:57 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results

* 86860 tests passed
* 1311 tests skipped
* 2 tests failed

## Failed Tests
(click on a test name to see its output)

### Clang
<details>
<summary>Clang.CXX/drs/cwg14xx.cpp</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++98 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++98 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp -verify=expected -fexceptions -fcxx-exceptions -pedantic-errors
# note: command had no output on stdout or stderr
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++11 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp -verify=expected,cxx11-17,since-cxx11, -fexceptions -fcxx-exceptions -pedantic-errors
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++11 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp -verify=expected,cxx11-17,since-cxx11, -fexceptions -fcxx-exceptions -pedantic-errors
# note: command had no output on stdout or stderr
# RUN: at line 3
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++14 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp -verify=expected,cxx14-17,cxx11-17,since-cxx11,since-cxx14 -fexceptions -fcxx-exceptions -pedantic-errors
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++14 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp -verify=expected,cxx14-17,cxx11-17,since-cxx11,since-cxx14 -fexceptions -fcxx-exceptions -pedantic-errors
# note: command had no output on stdout or stderr
# RUN: at line 4
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++17 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp -verify=expected,cxx14-17,cxx11-17,since-cxx11,since-cxx14 -fexceptions -fcxx-exceptions -pedantic-errors
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++17 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp -verify=expected,cxx14-17,cxx11-17,since-cxx11,since-cxx14 -fexceptions -fcxx-exceptions -pedantic-errors
# note: command had no output on stdout or stderr
# RUN: at line 5
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++20 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp -verify=expected,since-cxx11,since-cxx14,since-cxx20 -fexceptions -fcxx-exceptions -pedantic-errors
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++20 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp -verify=expected,since-cxx11,since-cxx14,since-cxx20 -fexceptions -fcxx-exceptions -pedantic-errors
# note: command had no output on stdout or stderr
# RUN: at line 6
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++23 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp -verify=expected,since-cxx11,since-cxx14,since-cxx20 -fexceptions -fcxx-exceptions -pedantic-errors
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++23 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp -verify=expected,since-cxx11,since-cxx14,since-cxx20 -fexceptions -fcxx-exceptions -pedantic-errors
# note: command had no output on stdout or stderr
# RUN: at line 7
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++2c /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp -verify=expected,since-cxx11,since-cxx14,since-cxx20 -fexceptions -fcxx-exceptions -pedantic-errors
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++2c /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp -verify=expected,since-cxx11,since-cxx14,since-cxx20 -fexceptions -fcxx-exceptions -pedantic-errors
# .---command stderr------------
# | error: diagnostics with 'error' severity expected but not seen: 
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 288 (directive at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp:289) 'since-cxx11-error': static assertion expression is not an integral constant expression
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 291 (directive at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp:292) 'since-cxx11-error': static assertion expression is not an integral constant expression
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 295 (directive at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp:296) 'since-cxx11-error': static assertion expression is not an integral constant expression
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 299 (directive at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp:300) 'since-cxx11-error': static assertion expression is not an integral constant expression
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 303 (directive at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp:304) 'since-cxx11-error': static assertion expression is not an integral constant expression
# | error: diagnostics with 'error' severity seen but not expected: 
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 138: attempt to use a deleted function
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 287: attempt to use a deleted function
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 288: attempt to use a deleted function
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 291: attempt to use a deleted function
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 294: attempt to use a deleted function
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 295: attempt to use a deleted function
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 298: attempt to use a deleted function
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 299: attempt to use a deleted function
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 302: attempt to use a deleted function
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 303: attempt to use a deleted function
# | error: diagnostics with 'note' severity expected but not seen: 
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 288 (directive at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp:290) 'since-cxx11-note': read of member 'b' of union with active member 'a' is not allowed in a constant expression
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 291 (directive at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp:293) 'since-cxx11-note': read of member 'a' of union with active member 'b' is not allowed in a constant expression
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 295 (directive at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp:297) 'since-cxx11-note': read of member 'b' of union with active member 'c' is not allowed in a constant expression
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 299 (directive at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp:301) 'since-cxx11-note': read of member 'a' of union with active member 'b' is not allowed in a constant expression
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 303 (directive at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp:305) 'since-cxx11-note': read of member 'c' of union with active member 'b' is not allowed in a constant expression
# | error: diagnostics with 'note' severity seen but not expected: 
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 131: destructor of 'A' is implicitly deleted because it has a user-provided default constructor
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 280: destructor of 'B' is implicitly deleted because it has a user-provided default constructor
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 280: destructor of 'B' is implicitly deleted because it has a user-provided default constructor
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 280: destructor of 'B' is implicitly deleted because it has a user-provided default constructor
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 280: destructor of 'B' is implicitly deleted because it has a user-provided default constructor
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 280: destructor of 'B' is implicitly deleted because it has a user-provided default constructor
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 280: destructor of 'B' is implicitly deleted because it has a user-provided default constructor
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 280: destructor of 'B' is implicitly deleted because it has a user-provided default constructor
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 280: destructor of 'B' is implicitly deleted because it has a user-provided default constructor
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg14xx.cpp Line 280: destructor of 'B' is implicitly deleted because it has a user-provided default constructor
# | 30 errors generated.
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>Clang.CXX/drs/cwg6xx.cpp</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++98 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg6xx.cpp -verify=expected,cxx98-17,cxx98-14,cxx98 -fexceptions -fcxx-exceptions -pedantic-errors
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++98 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg6xx.cpp -verify=expected,cxx98-17,cxx98-14,cxx98 -fexceptions -fcxx-exceptions -pedantic-errors
# note: command had no output on stdout or stderr
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++11 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg6xx.cpp -verify=expected,cxx11-20,cxx98-17,cxx11-17,cxx98-14,since-cxx11,cxx11 -fexceptions -fcxx-exceptions -pedantic-errors
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++11 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg6xx.cpp -verify=expected,cxx11-20,cxx98-17,cxx11-17,cxx98-14,since-cxx11,cxx11 -fexceptions -fcxx-exceptions -pedantic-errors
# note: command had no output on stdout or stderr
# RUN: at line 3
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++14 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg6xx.cpp -verify=expected,cxx11-20,cxx98-17,cxx11-17,cxx98-14,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++14 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg6xx.cpp -verify=expected,cxx11-20,cxx98-17,cxx11-17,cxx98-14,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors
# note: command had no output on stdout or stderr
# RUN: at line 4
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++17 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg6xx.cpp -verify=expected,cxx11-20,cxx98-17,cxx11-17,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++17 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg6xx.cpp -verify=expected,cxx11-20,cxx98-17,cxx11-17,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors
# note: command had no output on stdout or stderr
# RUN: at line 5
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++20 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg6xx.cpp -verify=expected,since-cxx20,cxx11-20,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++20 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg6xx.cpp -verify=expected,since-cxx20,cxx11-20,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors
# note: command had no output on stdout or stderr
# RUN: at line 6
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++23 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg6xx.cpp -verify=expected,since-cxx20,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++23 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg6xx.cpp -verify=expected,since-cxx20,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors
# note: command had no output on stdout or stderr
# RUN: at line 7
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++2c /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg6xx.cpp -verify=expected,since-cxx20,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -std=c++2c /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg6xx.cpp -verify=expected,since-cxx20,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors
# .---command stderr------------
# | error: diagnostics with 'error' severity seen but not expected: 
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/CXX/drs/cwg6xx.cpp Line 926: static assertion failed due to requirement '!__is_trivially_destructible(cwg667::C)': 
# | 1 error generated.
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

https://github.com/llvm/llvm-project/pull/185830


More information about the cfe-commits mailing list