[clang] [clang][ExprConstant] Reject integral casts of addr-label-diffs... (PR #171437)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 9 05:33:59 PST 2025
github-actions[bot] wrote:
<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results
* 84983 tests passed
* 1155 tests skipped
* 1 test failed
## Failed Tests
(click on a test name to see its output)
### Clang
<details>
<summary>Clang.AST/ast-dump-APValue-addrlabeldiff.c</summary>
```
Exit Code: 1
Command Output (stdout):
--
# 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/22/include -nostdsysteminc -std=c23 -ast-dump /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/AST/ast-dump-APValue-addrlabeldiff.c -ast-dump-filter Test | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --strict-whitespace --match-full-lines /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/AST/ast-dump-APValue-addrlabeldiff.c
# 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/22/include -nostdsysteminc -std=c23 -ast-dump /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/AST/ast-dump-APValue-addrlabeldiff.c -ast-dump-filter Test
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/AST/ast-dump-APValue-addrlabeldiff.c:15:18: error: constexpr variable 'ar' must be initialized by a constant expression
# | 15 | constexpr char ar = &&l2 - &&l1;
# | | ^ ~~~~~~~~~~~
# | 1 error generated.
# `-----------------------------
# error: command failed with exit status: 1
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck --strict-whitespace --match-full-lines /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/AST/ast-dump-APValue-addrlabeldiff.c
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/AST/ast-dump-APValue-addrlabeldiff.c:13:10: error: CHECK: expected string not found in input
# | // CHECK: | |-value: AddrLabelDiff &&l2 - &&l1
# | ^
# | <stdin>:1:1: note: scanning from here
# | Dumping Test:
# | ^
# | <stdin>:2:96: note: possible intended match here
# | FunctionDecl 0x43e296d8 </home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/AST/ast-dump-APValue-addrlabeldiff.c:14:1, line:20:1> line:14:5 Test 'int (void)'
# | ^
# |
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/AST/ast-dump-APValue-addrlabeldiff.c
# |
# | -dump-input=help explains the following input dump.
# |
# | Input was:
# | <<<<<<
# | 1: Dumping Test:
# | check:13'0 X~~~~~~~~~~~~~ error: no match found
# | 2: FunctionDecl 0x43e296d8 </home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/AST/ast-dump-APValue-addrlabeldiff.c:14:1, line:20:1> line:14:5 Test 'int (void)'
# | check:13'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:13'1 ? possible intended match
# | 3: `-CompoundStmt 0x43e29a78 <col:16, line:20:1>
# | check:13'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 4: |-DeclStmt 0x43e299c0 <line:15:3, col:34>
# | check:13'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 5: | `-VarDecl 0x43e297d8 <col:3, col:32> col:18 ar 'const char' constexpr cinit
# | check:13'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 6: | `-ImplicitCastExpr 0x43e29960 <col:23, col:32> 'char' <IntegralCast>
# | check:13'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | 7: | `-BinaryOperator 0x43e29940 <col:23, col:32> '__ptrdiff_t':'long' '-'
# | check:13'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | .
# | .
# | .
# | >>>>>>
# `-----------------------------
# 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/171437
More information about the cfe-commits
mailing list