[clang] [Clang] Fixed a crash when instantiating an invalid out-of-line static data member definition in a local class (PR #196772)

via cfe-commits cfe-commits at lists.llvm.org
Sat May 9 20:31:23 PDT 2026


github-actions[bot] wrote:

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

* 87912 tests passed
* 1553 tests skipped
* 1 test failed

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

### Clang
<details>
<summary>Clang.SemaTemplate/gh176152.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 -fsyntax-only -verify /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/SemaTemplate/gh176152.cpp
# 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 -fsyntax-only -verify /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/SemaTemplate/gh176152.cpp
# .---command stderr------------
# | error: 'expected-error' diagnostics expected but not seen: 
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/SemaTemplate/gh176152.cpp Line 5 (directive at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/SemaTemplate/gh176152.cpp:6): static data member 'staticField' not allowed in local struct 'MyClass'
# | error: 'expected-error' diagnostics seen but not expected: 
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/SemaTemplate/gh176152.cpp Line 5: static data member 'B' not allowed in local struct 'A'
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/SemaTemplate/gh176152.cpp Line 9: redefinition of 'B'
# | error: 'expected-note' diagnostics seen but not expected: 
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/SemaTemplate/gh176152.cpp Line 8: previous definition is here
# | 4 errors 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/196772


More information about the cfe-commits mailing list