[libcxx-commits] [clang-tools-extra] [libcxx] [clang-tools-extra]: Check for static in constexpr (PR #175814)

via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jan 13 11:16:43 PST 2026


github-actions[bot] wrote:

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

* 3019 tests passed
* 29 tests skipped
* 1 test failed

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

### Clang Tools
<details>
<summary>Clang Tools.clang-tidy/checkers/misc/static-in-constexpr.cpp</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
C:/Python312/python.exe C:/_work/llvm-project/llvm-project/clang-tools-extra/test/../test\clang-tidy\check_clang_tidy.py -std=c++20 C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\checkers\misc\static-in-constexpr.cpp misc-static-in-constexpr C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\misc\Output\static-in-constexpr.cpp.tmp
# executed command: C:/Python312/python.exe 'C:/_work/llvm-project/llvm-project/clang-tools-extra/test/../test\clang-tidy\check_clang_tidy.py' -std=c++20 'C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\checkers\misc\static-in-constexpr.cpp' misc-static-in-constexpr 'C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\misc\Output\static-in-constexpr.cpp.tmp'
# .---command stdout------------
# | Running ['clang-tidy', '--experimental-custom-checks', 'C:\\_work\\llvm-project\\llvm-project\\build\\tools\\clang\\tools\\extra\\test\\clang-tidy\\checkers\\misc\\Output\\static-in-constexpr.cpp.tmp.cpp', '-fix', '--checks=-*,misc-static-in-constexpr', '--config={}', '--', '-std=c++20', '-nostdinc++']...
# | clang-tidy --experimental-custom-checks C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\misc\Output\static-in-constexpr.cpp.tmp.cpp -fix --checks=-*,misc-static-in-constexpr --config={} -- -std=c++20 -nostdinc++ failed:
# | 10 warnings and 4 errors generated.
# | 
# | Error while processing C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\misc\Output\static-in-constexpr.cpp.tmp.cpp.
# | 
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\misc\Output\static-in-constexpr.cpp.tmp.cpp:9:16: error: constexpr function never produces a constant expression [clang-diagnostic-invalid-constexpr]
# |     9 | constexpr void constexpr_func() {
# |       |                ^~~~~~~~~~~~~~
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\misc\Output\static-in-constexpr.cpp.tmp.cpp:10:14: note: control flows through the definition of a static variable
# |    10 |   static int x = 0;
# |       |              ^
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\misc\Output\static-in-constexpr.cpp.tmp.cpp:10:14: warning: variable of static or thread storage duration inside constexpr function [misc-static-in-constexpr]
# |    10 |   static int x = 0;
# |       |              ^
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\misc\Output\static-in-constexpr.cpp.tmp.cpp:13:20: warning: variable of static or thread storage duration inside constexpr function [misc-static-in-constexpr]
# |    13 |   thread_local int y = 0;
# |       |                    ^
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\misc\Output\static-in-constexpr.cpp.tmp.cpp:17:16: error: consteval function never produces a constant expression [clang-diagnostic-invalid-constexpr]
# |    17 | consteval void consteval_func() {
# |       |                ^~~~~~~~~~~~~~
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\misc\Output\static-in-constexpr.cpp.tmp.cpp:18:14: note: control flows through the definition of a static variable
# |    18 |   static int x = 0;
# |       |              ^
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\misc\Output\static-in-constexpr.cpp.tmp.cpp:18:14: warning: variable of static or thread storage duration inside constexpr function [misc-static-in-constexpr]
# |    18 |   static int x = 0;
# |       |              ^
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\misc\Output\static-in-constexpr.cpp.tmp.cpp:30:12: error: constexpr function never produces a constant expression [clang-diagnostic-invalid-constexpr]
# |    30 |   auto l = []() constexpr {
# |       |            ^
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\misc\Output\static-in-constexpr.cpp.tmp.cpp:31:16: note: control flows through the definition of a static variable
# |    31 |     static int x = 0;
# |       |                ^
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\misc\Output\static-in-constexpr.cpp.tmp.cpp:31:16: warning: variable of static or thread storage duration inside constexpr function [misc-static-in-constexpr]
# |    31 |     static int x = 0;
# |       |                ^
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\misc\Output\static-in-constexpr.cpp.tmp.cpp:37:27: error: constexpr function never produces a constant expression [clang-diagnostic-invalid-constexpr]
# |    37 |     static constexpr void static_member_func() {
# |       |                           ^~~~~~~~~~~~~~~~~~
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\misc\Output\static-in-constexpr.cpp.tmp.cpp:38:20: note: control flows through the definition of a static variable
# |    38 |         static int x = 0;
# |       |                    ^
# | C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\checkers\misc\Output\static-in-constexpr.cpp.tmp.cpp:38:20: warning: variable of static or thread storage duration inside constexpr function [misc-static-in-constexpr]
# |    38 |         static int x = 0;
# |       |                    ^
# | Suppressed 5 warnings (5 with check filters).
# | 
# | Found compiler errors, but -fix-errors was not specified.
# | 
# | Fixes have NOT been applied.
# | 
# | 
# | 
# | Found compiler error(s).
# | 
# | 
# `-----------------------------
# .---command stderr------------
# | Traceback (most recent call last):
# |   File "C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\check_clang_tidy.py", line 413, in <module>
# |     main()
# |   File "C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\check_clang_tidy.py", line 409, in main
# |     CheckRunner(args, extra_args).run()
# |   File "C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\check_clang_tidy.py", line 307, in run
# |     clang_tidy_output = self.run_clang_tidy()
# |                         ^^^^^^^^^^^^^^^^^^^^^
# |   File "C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\check_clang_tidy.py", line 232, in run_clang_tidy
# |     clang_tidy_output = try_run(args)
# |                         ^^^^^^^^^^^^^
# |   File "C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\check_clang_tidy.py", line 63, in try_run
# |     process_output = subprocess.check_output(args, stderr=subprocess.STDOUT).decode(
# |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# |   File "c:\python312\Lib\subprocess.py", line 466, in check_output
# |     return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
# |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# |   File "c:\python312\Lib\subprocess.py", line 571, in run
# |     raise CalledProcessError(retcode, process.args,
# | subprocess.CalledProcessError: Command '['clang-tidy', '--experimental-custom-checks', 'C:\\_work\\llvm-project\\llvm-project\\build\\tools\\clang\\tools\\extra\\test\\clang-tidy\\checkers\\misc\\Output\\static-in-constexpr.cpp.tmp.cpp', '-fix', '--checks=-*,misc-static-in-constexpr', '--config={}', '--', '-std=c++20', '-nostdinc++']' returned non-zero exit status 1.
# `-----------------------------
# 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/175814


More information about the libcxx-commits mailing list