[clang] [Clang] Fix a crash when checking the constraints of a self-referential concept (PR #208465)

via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 9 07:15:43 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results

* 55707 tests passed
* 1376 tests skipped
* 2 tests failed

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

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

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -std=c++98 -triple x86_64-unknown-unknown C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg25xx.cpp -fexceptions -fcxx-exceptions -pedantic-errors -verify-directives -verify=expected
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -std=c++98 -triple x86_64-unknown-unknown 'C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg25xx.cpp' -fexceptions -fcxx-exceptions -pedantic-errors -verify-directives -verify=expected
# note: command had no output on stdout or stderr
# RUN: at line 2
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -std=c++11 -triple x86_64-unknown-unknown C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg25xx.cpp -fexceptions -fcxx-exceptions -pedantic-errors -verify-directives -verify=expected,cxx11-14,since-cxx11
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -std=c++11 -triple x86_64-unknown-unknown 'C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg25xx.cpp' -fexceptions -fcxx-exceptions -pedantic-errors -verify-directives -verify=expected,cxx11-14,since-cxx11
# note: command had no output on stdout or stderr
# RUN: at line 3
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -std=c++14 -triple x86_64-unknown-unknown C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg25xx.cpp -fexceptions -fcxx-exceptions -pedantic-errors -verify-directives -verify=expected,cxx11-14,since-cxx11
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -std=c++14 -triple x86_64-unknown-unknown 'C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg25xx.cpp' -fexceptions -fcxx-exceptions -pedantic-errors -verify-directives -verify=expected,cxx11-14,since-cxx11
# note: command had no output on stdout or stderr
# RUN: at line 4
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -std=c++17 -triple x86_64-unknown-unknown C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg25xx.cpp -fexceptions -fcxx-exceptions -pedantic-errors -verify-directives -verify=expected,since-cxx11
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -std=c++17 -triple x86_64-unknown-unknown 'C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg25xx.cpp' -fexceptions -fcxx-exceptions -pedantic-errors -verify-directives -verify=expected,since-cxx11
# note: command had no output on stdout or stderr
# RUN: at line 5
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -std=c++20 -triple x86_64-unknown-unknown C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg25xx.cpp -fexceptions -fcxx-exceptions -pedantic-errors -verify-directives -verify=expected,since-cxx11,since-cxx20
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -std=c++20 -triple x86_64-unknown-unknown 'C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg25xx.cpp' -fexceptions -fcxx-exceptions -pedantic-errors -verify-directives -verify=expected,since-cxx11,since-cxx20
# .---command stderr------------
# | error: diagnostics with 'error' severity expected but not seen: 
# |   File C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg25xx.cpp Line 249 (directive at C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg25xx.cpp:250) 'since-cxx20-error': static assertion failed
# |   File C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg25xx.cpp Line 263 (directive at C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg25xx.cpp:264) 'since-cxx20-error': static assertion failed
# | error: diagnostics with 'note' severity expected but not seen: 
# |   File C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg25xx.cpp Line 249 (directive at C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg25xx.cpp:250) 'since-cxx20-note': because 'int' does not satisfy 'ErrorRequires'
# |   File C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg25xx.cpp Line 243 (directive at C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg25xx.cpp:250) 'since-cxx20-note': because substituted constraint expression is ill-formed: constraint depends on a previously diagnosed expression
# |   File C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg25xx.cpp Line 263 (directive at C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg25xx.cpp:264) 'since-cxx20-note': because 'int' does not satisfy 'NestedErrorInRequires'
# |   File C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg25xx.cpp Line 256 (directive at C:\_work\llvm-project\llvm-project\clang\test\CXX\drs\cwg25xx.cpp:264) 'since-cxx20-note-re': because {{.*}} would be invalid: constraint depends on a previously diagnosed expression
# | 6 errors generated.
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>Clang.SemaTemplate/concepts.cpp</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -std=c++20 -ferror-limit 0 -fexceptions -fcxx-exceptions -verify=expected,cxx20 C:\_work\llvm-project\llvm-project\clang\test\SemaTemplate\concepts.cpp
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -std=c++20 -ferror-limit 0 -fexceptions -fcxx-exceptions -verify=expected,cxx20 'C:\_work\llvm-project\llvm-project\clang\test\SemaTemplate\concepts.cpp'
# .---command stderr------------
# | error: diagnostics with 'error' severity expected but not seen: 
# |   File C:\_work\llvm-project\llvm-project\clang\test\SemaTemplate\concepts.cpp Line 1011 (directive at C:\_work\llvm-project\llvm-project\clang\test\SemaTemplate\concepts.cpp:1012) 'expected-error': a concept definition cannot refer to itself
# |   File C:\_work\llvm-project\llvm-project\clang\test\SemaTemplate\concepts.cpp Line 1011 (directive at C:\_work\llvm-project\llvm-project\clang\test\SemaTemplate\concepts.cpp:1012) 'expected-error': a concept definition cannot refer to itself
# |   File C:\_work\llvm-project\llvm-project\clang\test\SemaTemplate\concepts.cpp Line 1011 (directive at C:\_work\llvm-project\llvm-project\clang\test\SemaTemplate\concepts.cpp:1012) 'expected-error': a concept definition cannot refer to itself
# |   File C:\_work\llvm-project\llvm-project\clang\test\SemaTemplate\concepts.cpp Line 1034 'expected-error': no matching function
# | error: diagnostics with 'note' severity expected but not seen: 
# |   File C:\_work\llvm-project\llvm-project\clang\test\SemaTemplate\concepts.cpp Line 1000 'expected-note': 'false' evaluated to false
# |   File C:\_work\llvm-project\llvm-project\clang\test\SemaTemplate\concepts.cpp Line 1011 (directive at C:\_work\llvm-project\llvm-project\clang\test\SemaTemplate\concepts.cpp:1012) 'expected-note': declared here
# |   File C:\_work\llvm-project\llvm-project\clang\test\SemaTemplate\concepts.cpp Line 1011 (directive at C:\_work\llvm-project\llvm-project\clang\test\SemaTemplate\concepts.cpp:1012) 'expected-note': declared here
# |   File C:\_work\llvm-project\llvm-project\clang\test\SemaTemplate\concepts.cpp Line 1011 (directive at C:\_work\llvm-project\llvm-project\clang\test\SemaTemplate\concepts.cpp:1012) 'expected-note': declared here
# |   File C:\_work\llvm-project\llvm-project\clang\test\SemaTemplate\concepts.cpp Line 1026 'expected-note': candidate template ignored: constraints not satisfied
# |   File C:\_work\llvm-project\llvm-project\clang\test\SemaTemplate\concepts.cpp Line 1027 'expected-note': because 'unsigned long' does not satisfy 'False'
# | 10 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/208465


More information about the cfe-commits mailing list