[clang] [llvm] [Clang] Fix assertion failure when passing wide string literal to __builtin_nanf (PR #205452)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 24 10:04:34 PDT 2026


github-actions[bot] wrote:

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

* 88396 tests passed
* 1679 tests skipped
* 2 tests failed

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

### Clang
<details>
<summary>Clang.Sema/builtin-nan-wide-string.c</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=c -x c /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.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/23/include -nostdsysteminc -fsyntax-only -verify=c -x c /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c
# .---command stderr------------
# | error: 'c-error' diagnostics seen but not expected: 
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c Line 12: incompatible pointer types passing 'int[1]' to parameter of type 'const char *'
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c Line 12: initializer element is not a compile-time constant
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c Line 16: incompatible pointer types passing 'int[1]' to parameter of type 'const char *'
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c Line 16: initializer element is not a compile-time constant
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c Line 20: incompatible pointer types passing 'int[1]' to parameter of type 'const char *'
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c Line 20: initializer element is not a compile-time constant
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c Line 24: incompatible pointer types passing 'unsigned short[1]' to parameter of type 'const char *'
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c Line 24: initializer element is not a compile-time constant
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c Line 28: incompatible pointer types passing 'unsigned short[1]' to parameter of type 'const char *'
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c Line 28: initializer element is not a compile-time constant
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c Line 32: incompatible pointer types passing 'unsigned short[1]' to parameter of type 'const char *'
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c Line 32: initializer element is not a compile-time constant
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c Line 36: incompatible pointer types passing 'unsigned int[1]' to parameter of type 'const char *'
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c Line 36: initializer element is not a compile-time constant
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c Line 40: incompatible pointer types passing 'unsigned int[1]' to parameter of type 'const char *'
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c Line 40: initializer element is not a compile-time constant
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c Line 44: incompatible pointer types passing 'unsigned int[1]' to parameter of type 'const char *'
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c Line 44: initializer element is not a compile-time constant
# | error: 'c-warning' diagnostics expected but not seen: 
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c Line 12 (directive at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c:13): incompatible pointer types passing 'int[1]' to parameter of type 'const char *'
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c Line 16 (directive at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c:17): incompatible pointer types passing 'int[1]' to parameter of type 'const char *'
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c Line 20 (directive at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c:21): incompatible pointer types passing 'int[1]' to parameter of type 'const char *'
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c Line 24 (directive at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c:25): incompatible pointer types passing 'unsigned short[1]' to parameter of type 'const char *'
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c Line 28 (directive at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c:29): incompatible pointer types passing 'unsigned short[1]' to parameter of type 'const char *'
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c Line 32 (directive at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c:33): incompatible pointer types passing 'unsigned short[1]' to parameter of type 'const char *'
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c Line 36 (directive at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c:37): incompatible pointer types passing 'unsigned int[1]' to parameter of type 'const char *'
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c Line 40 (directive at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c:41): incompatible pointer types passing 'unsigned int[1]' to parameter of type 'const char *'
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c Line 44 (directive at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/builtin-nan-wide-string.c:45): incompatible pointer types passing 'unsigned int[1]' to parameter of type 'const char *'
# | 27 errors generated.
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>Clang.Sema/constant-builtins-2.c</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/Sema/constant-builtins-2.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/23/include -nostdsysteminc -fsyntax-only -verify /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/constant-builtins-2.c
# .---command stderr------------
# | error: 'expected-error' diagnostics seen but not expected: 
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/constant-builtins-2.c Line 23: initializer element is not a compile-time constant
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/constant-builtins-2.c Line 24: initializer element is not a compile-time constant
# |   File /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Sema/constant-builtins-2.c Line 25: initializer element is not a compile-time constant
# | 3 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/205452


More information about the cfe-commits mailing list