[clang] [AST] Use llvm::PointerUnion<Decl *, DeclGroup *> in DeclGroupRef (PR #238331)

LLVM Continuous Integration via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 1 22:34:05 PST 2026


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `openmp-offload-amdgpu-runtime-2` running on `rocm-worker-hw-02` while building `clang` at step 3 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/10/builds/40573

<details>
<summary>Here is the relevant piece of the build log for the reference</summary>

```
Step 3 (annotate) failure: 'python ../llvm.src/offload/ci/openmp-offload-amdgpu-libc-runtime.py ...' (failure)
...
PASS: libomp :: ompt/synchronization/nest_lock.c (128 of 537)
PASS: libomp :: env/omp_thread_limit.c (129 of 537)
PASS: libomp :: env/omp_wait_policy.c (130 of 537)
PASS: libomp :: ompt/misc/control_tool_no_callback.c (131 of 537)
PASS: libomp :: ompt/misc/control_tool_no_ompt_support.c (132 of 537)
PASS: libomp :: atomic/omp_atomic.c (133 of 537)
PASS: libomp :: barrier/llvm-issue-80664.c (134 of 537)
PASS: libomp :: ompt/synchronization/critical.c (135 of 537)
PASS: libomp :: ompt/synchronization/flush.c (136 of 537)
PASS: libomp :: misc_bugs/omp_nothing.c (137 of 537)
FAIL: libomp :: misc_bugs/simd_conservative_ordered.c (138 of 537)
******************** TEST 'libomp :: misc_bugs/simd_conservative_ordered.c' FAILED ********************
Exit Code: -6

Command Output (stdout):
--
# RUN: at line 1
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/./bin/clang -fopenmp   -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/runtime/test -L /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src  -fno-omit-frame-pointer -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/runtime/test/ompt /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/runtime/test/misc_bugs/simd_conservative_ordered.c -o /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/test/misc_bugs/Output/simd_conservative_ordered.c.tmp -lm -latomic -O3 -ffast-math
# executed command: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/./bin/clang -fopenmp -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/runtime/test -L /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -fno-omit-frame-pointer -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/runtime/test/ompt /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/runtime/test/misc_bugs/simd_conservative_ordered.c -o /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/test/misc_bugs/Output/simd_conservative_ordered.c.tmp -lm -latomic -O3 -ffast-math
# .---command stderr------------
# | clang-24: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/include/llvm/Support/Casting.h:656: decltype(auto) llvm::dyn_cast(From*) [with To = clang::NamedDecl; From = clang::Decl]: Assertion `detail::isPresent(Val) && "dyn_cast on a non-existent value"' failed.
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and dumped files.
# | Stack dump:
# | 0.	Program arguments: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/clang-24 -cc1 -triple x86_64-unknown-linux-gnu -O3 -emit-obj -dumpdir /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/test/misc_bugs/Output/simd_conservative_ordered.c.tmp- -disable-free -clear-ast-before-backend -main-file-name simd_conservative_ordered.c -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -menable-no-infs -menable-no-nans -fapprox-func -funsafe-math-optimizations -fno-signed-zeros -mreassociate -freciprocal-math -ffp-contract=fast -fno-rounding-math -ffast-math -ffinite-math-only -complex-range=basic -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/test/misc_bugs -fcoverage-compilation-dir=/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/test/misc_bugs -resource-dir /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/lib/clang/24 -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/runtime/test -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/runtime/test/ompt -internal-isystem /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/lib/clang/24/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -ferror-limit 19 -fopenmp -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -vectorize-loops -vectorize-slp -faddrsig -fdwarf2-cfi-asm -o /tmp/lit-tmp-ls9ss0v6/simd_conservative_ordered-31652a.o -x c /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/runtime/test/misc_bugs/simd_conservative_ordered.c
# | 1.	/usr/include/x86_64-linux-gnu/bits/mathcalls.h:53:1 <Spelling=<scratch space>:57:19>: current parser token 'notinbranch'
# |  #0 0x000072a63023f559 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/libLLVMSupport.so.24.0git+0x23f559)
# |  #1 0x000072a63023c24c llvm::sys::RunSignalHandlers() (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/libLLVMSupport.so.24.0git+0x23c24c)
# |  #2 0x000072a63023c3b6 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
# |  #3 0x000072a63023c47c SignalHandlerTerminate(int, siginfo_t*, void*) Signals.cpp:0:0
# |  #4 0x000072a62f8424b0 (/lib/x86_64-linux-gnu/libc.so.6+0x424b0)
# |  #5 0x000072a62f89691c __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
# |  #6 0x000072a62f89691c __pthread_kill_internal ./nptl/pthread_kill.c:78:10
# |  #7 0x000072a62f89691c pthread_kill ./nptl/pthread_kill.c:89:10
# |  #8 0x000072a62f842406 gsignal ./signal/../sysdeps/posix/raise.c:27:6
# |  #9 0x000072a62f8287f3 abort ./stdlib/abort.c:81:7
# | #10 0x000072a62f82871b _nl_load_domain ./intl/loadmsgcat.c:1177:9
# | #11 0x000072a62f839e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
# | #12 0x000072a62e93b783 clang::Parser::ParseOMPDeclareSimdClauses(clang::OpaquePtr<clang::DeclGroupRef>, llvm::SmallVector<clang::Token, 4u>&, clang::SourceLocation) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/../lib/libclangParse.so.24.0git+0x127783)
# | #13 0x000072a62e944369 clang::Parser::ParseOpenMPDeclarativeDirectiveWithExtDecl(clang::AccessSpecifier&, clang::ParsedAttributes&, bool, clang::TypeSpecifierType, clang::Decl*) (.part.0) ParseOpenMP.cpp:0:0
# | #14 0x000072a62e9a7563 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/../lib/libclangParse.so.24.0git+0x193563)
# | #15 0x000072a62e9a84cd clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/../lib/libclangParse.so.24.0git+0x1944cd)
# | #16 0x000072a62e859459 clang::ParseAST(clang::Sema&, bool, bool) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/../lib/libclangParse.so.24.0git+0x45459)
# | #17 0x000072a632d55941 clang::FrontendAction::Execute() (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/libclangFrontend.so.24.0git+0x155941)
# | #18 0x000072a632cd583d clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/libclangFrontend.so.24.0git+0xd583d)
# | #19 0x000072a638f08fd3 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/libclangFrontendTool.so.24.0git+0x7fd3)
# | #20 0x0000561ac611f8fa cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/clang-24+0x168fa)
# | #21 0x0000561ac611687a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) driver.cpp:0:0
# | #22 0x0000561ac611aadb clang_main(int, char**, llvm::ToolContext const&) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/clang-24+0x11adb)
# | #23 0x0000561ac6115e4a main (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/clang-24+0xce4a)
Step 8 (run check-openmp) failure: run check-openmp (failure)
...
PASS: libomp :: ompt/synchronization/nest_lock.c (128 of 537)
PASS: libomp :: env/omp_thread_limit.c (129 of 537)
PASS: libomp :: env/omp_wait_policy.c (130 of 537)
PASS: libomp :: ompt/misc/control_tool_no_callback.c (131 of 537)
PASS: libomp :: ompt/misc/control_tool_no_ompt_support.c (132 of 537)
PASS: libomp :: atomic/omp_atomic.c (133 of 537)
PASS: libomp :: barrier/llvm-issue-80664.c (134 of 537)
PASS: libomp :: ompt/synchronization/critical.c (135 of 537)
PASS: libomp :: ompt/synchronization/flush.c (136 of 537)
PASS: libomp :: misc_bugs/omp_nothing.c (137 of 537)
FAIL: libomp :: misc_bugs/simd_conservative_ordered.c (138 of 537)
******************** TEST 'libomp :: misc_bugs/simd_conservative_ordered.c' FAILED ********************
Exit Code: -6

Command Output (stdout):
--
# RUN: at line 1
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/./bin/clang -fopenmp   -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/runtime/test -L /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src  -fno-omit-frame-pointer -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/runtime/test/ompt /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/runtime/test/misc_bugs/simd_conservative_ordered.c -o /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/test/misc_bugs/Output/simd_conservative_ordered.c.tmp -lm -latomic -O3 -ffast-math
# executed command: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/./bin/clang -fopenmp -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/runtime/test -L /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -fno-omit-frame-pointer -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/runtime/test/ompt /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/runtime/test/misc_bugs/simd_conservative_ordered.c -o /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/test/misc_bugs/Output/simd_conservative_ordered.c.tmp -lm -latomic -O3 -ffast-math
# .---command stderr------------
# | clang-24: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/include/llvm/Support/Casting.h:656: decltype(auto) llvm::dyn_cast(From*) [with To = clang::NamedDecl; From = clang::Decl]: Assertion `detail::isPresent(Val) && "dyn_cast on a non-existent value"' failed.
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and dumped files.
# | Stack dump:
# | 0.	Program arguments: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/clang-24 -cc1 -triple x86_64-unknown-linux-gnu -O3 -emit-obj -dumpdir /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/test/misc_bugs/Output/simd_conservative_ordered.c.tmp- -disable-free -clear-ast-before-backend -main-file-name simd_conservative_ordered.c -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -menable-no-infs -menable-no-nans -fapprox-func -funsafe-math-optimizations -fno-signed-zeros -mreassociate -freciprocal-math -ffp-contract=fast -fno-rounding-math -ffast-math -ffinite-math-only -complex-range=basic -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/test/misc_bugs -fcoverage-compilation-dir=/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/test/misc_bugs -resource-dir /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/lib/clang/24 -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/runtime/test -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/runtime/test/ompt -internal-isystem /home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/lib/clang/24/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -ferror-limit 19 -fopenmp -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -vectorize-loops -vectorize-slp -faddrsig -fdwarf2-cfi-asm -o /tmp/lit-tmp-ls9ss0v6/simd_conservative_ordered-31652a.o -x c /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/runtime/test/misc_bugs/simd_conservative_ordered.c
# | 1.	/usr/include/x86_64-linux-gnu/bits/mathcalls.h:53:1 <Spelling=<scratch space>:57:19>: current parser token 'notinbranch'
# |  #0 0x000072a63023f559 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/libLLVMSupport.so.24.0git+0x23f559)
# |  #1 0x000072a63023c24c llvm::sys::RunSignalHandlers() (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/libLLVMSupport.so.24.0git+0x23c24c)
# |  #2 0x000072a63023c3b6 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
# |  #3 0x000072a63023c47c SignalHandlerTerminate(int, siginfo_t*, void*) Signals.cpp:0:0
# |  #4 0x000072a62f8424b0 (/lib/x86_64-linux-gnu/libc.so.6+0x424b0)
# |  #5 0x000072a62f89691c __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
# |  #6 0x000072a62f89691c __pthread_kill_internal ./nptl/pthread_kill.c:78:10
# |  #7 0x000072a62f89691c pthread_kill ./nptl/pthread_kill.c:89:10
# |  #8 0x000072a62f842406 gsignal ./signal/../sysdeps/posix/raise.c:27:6
# |  #9 0x000072a62f8287f3 abort ./stdlib/abort.c:81:7
# | #10 0x000072a62f82871b _nl_load_domain ./intl/loadmsgcat.c:1177:9
# | #11 0x000072a62f839e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
# | #12 0x000072a62e93b783 clang::Parser::ParseOMPDeclareSimdClauses(clang::OpaquePtr<clang::DeclGroupRef>, llvm::SmallVector<clang::Token, 4u>&, clang::SourceLocation) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/../lib/libclangParse.so.24.0git+0x127783)
# | #13 0x000072a62e944369 clang::Parser::ParseOpenMPDeclarativeDirectiveWithExtDecl(clang::AccessSpecifier&, clang::ParsedAttributes&, bool, clang::TypeSpecifierType, clang::Decl*) (.part.0) ParseOpenMP.cpp:0:0
# | #14 0x000072a62e9a7563 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/../lib/libclangParse.so.24.0git+0x193563)
# | #15 0x000072a62e9a84cd clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/../lib/libclangParse.so.24.0git+0x1944cd)
# | #16 0x000072a62e859459 clang::ParseAST(clang::Sema&, bool, bool) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/../lib/libclangParse.so.24.0git+0x45459)
# | #17 0x000072a632d55941 clang::FrontendAction::Execute() (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/libclangFrontend.so.24.0git+0x155941)
# | #18 0x000072a632cd583d clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/libclangFrontend.so.24.0git+0xd583d)
# | #19 0x000072a638f08fd3 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/../lib/libclangFrontendTool.so.24.0git+0x7fd3)
# | #20 0x0000561ac611f8fa cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/clang-24+0x168fa)
# | #21 0x0000561ac611687a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) driver.cpp:0:0
# | #22 0x0000561ac611aadb clang_main(int, char**, llvm::ToolContext const&) (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/clang-24+0x11adb)
# | #23 0x0000561ac6115e4a main (/home/botworker/builds/openmp-offload-amdgpu-runtime-2/build/llvm.build/bin/clang-24+0xce4a)

```

</details>

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


More information about the cfe-commits mailing list