[clang] [clang][ExprConstant] Reject integral casts of addr-label-diffs... (PR #171437)

LLVM Continuous Integration via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 25 23:05:34 PST 2025


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `clang-armv7-global-isel` running on `linaro-clang-armv7-global-isel` while building `clang` at step 7 "ninja check 1".

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

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

```
Step 7 (ninja check 1) failure: stage 1 checked (failure)
******************** TEST 'Clang :: AST/ast-dump-APValue-addrlabeldiff.c' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/bin/clang -cc1 -internal-isystem /home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/lib/clang/22/include -nostdsysteminc -std=c23 -ast-dump /home/tcwg-buildbot/worker/clang-armv7-global-isel/llvm/clang/test/AST/ast-dump-APValue-addrlabeldiff.c -ast-dump-filter Test  | /home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/bin/FileCheck --strict-whitespace --match-full-lines /home/tcwg-buildbot/worker/clang-armv7-global-isel/llvm/clang/test/AST/ast-dump-APValue-addrlabeldiff.c
# executed command: /home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/bin/clang -cc1 -internal-isystem /home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/lib/clang/22/include -nostdsysteminc -std=c23 -ast-dump /home/tcwg-buildbot/worker/clang-armv7-global-isel/llvm/clang/test/AST/ast-dump-APValue-addrlabeldiff.c -ast-dump-filter Test
# .---command stderr------------
# | /home/tcwg-buildbot/worker/clang-armv7-global-isel/llvm/clang/test/AST/ast-dump-APValue-addrlabeldiff.c:15:23: error: constexpr variable 'ar' must be initialized by a constant expression
# |    15 |   constexpr long long ar = &&l2 - &&l1;
# |       |                       ^    ~~~~~~~~~~~
# | 1 error generated.
# `-----------------------------
# error: command failed with exit status: 1
# executed command: /home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/bin/FileCheck --strict-whitespace --match-full-lines /home/tcwg-buildbot/worker/clang-armv7-global-isel/llvm/clang/test/AST/ast-dump-APValue-addrlabeldiff.c
# .---command stderr------------
# | /home/tcwg-buildbot/worker/clang-armv7-global-isel/llvm/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:95: note: possible intended match here
# | FunctionDecl 0x13119fa8 </home/tcwg-buildbot/worker/clang-armv7-global-isel/llvm/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/tcwg-buildbot/worker/clang-armv7-global-isel/llvm/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 0x13119fa8 </home/tcwg-buildbot/worker/clang-armv7-global-isel/llvm/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 0x1311a264 <col:16, line:20:1> 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             4:   |-DeclStmt 0x1311a1c0 <line:15:3, col:39> 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             5:   | `-VarDecl 0x1311a060 <col:3, col:37> col:23 ar 'const long long' constexpr cinit 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             6:   |   `-ImplicitCastExpr 0x1311a168 <col:28, col:37> 'long long' <IntegralCast> 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             7:   |     `-BinaryOperator 0x1311a150 <col:28, col:37> '__ptrdiff_t':'int' '-' 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             .
...

```

</details>

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


More information about the cfe-commits mailing list