[clang] [clang] Allow `$` in identifiers during preprocessing (PR #200614)

via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 4 09:36:41 PDT 2026


github-actions[bot] wrote:

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

* 54605 tests passed
* 1105 tests skipped
* 3 tests failed

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

### Clang
<details>
<summary>Clang.Lexer/dollar-idents.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 -dump-tokens /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Lexer/dollar-idents.c 2>&1 | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Lexer/dollar-idents.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 -dump-tokens /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Lexer/dollar-idents.c
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Lexer/dollar-idents.c
# note: command had no output on stdout or stderr
# 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/23/include -nostdsysteminc -dump-tokens -x assembler-with-cpp /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Lexer/dollar-idents.c 2>&1 | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Lexer/dollar-idents.c --check-prefix=CHECK-ASM
# 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 -dump-tokens -x assembler-with-cpp /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Lexer/dollar-idents.c
# note: command had no output on stdout or stderr
# error: command failed with exit status: 1
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Lexer/dollar-idents.c --check-prefix=CHECK-ASM
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Lexer/dollar-idents.c:6:15: error: CHECK-ASM: expected string not found in input
# | // CHECK-ASM: identifier 'A'
# |               ^
# | <stdin>:1:1: note: scanning from here
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Lexer/dollar-idents.c:7:1: error: identifier '$A' is not supported with the current configuration
# | ^
# | <stdin>:1:103: note: possible intended match here
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Lexer/dollar-idents.c:7:1: error: identifier '$A' is not supported with the current configuration
# |                                                                                                       ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Lexer/dollar-idents.c
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            1: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Lexer/dollar-idents.c:7:1: error: identifier '$A' is not supported with the current configuration 
# | check:6'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
# | check:6'1                                                                                                           ?                                                                possible intended match
# |            2:  7 | $A 
# | check:6'0     ~~~~~~~~
# |            3:  | ^ 
# | check:6'0     ~~~~~
# |            4: identifier '$A' Loc=</home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Lexer/dollar-idents.c:7:1> [StartOfLine] 
# | check:6'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            5: eof '' Loc=</home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Lexer/dollar-idents.c:7:3>  
# | check:6'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            6: 1 error generated. 
# | check:6'0     ~~~~~~~~~~~~~~~~~~~
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>Clang.Preprocessor/assembler-with-cpp.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 -x assembler-with-cpp -E /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Preprocessor/assembler-with-cpp.c -o - | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -strict-whitespace -check-prefix=CHECK-Identifiers-False /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Preprocessor/assembler-with-cpp.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 -x assembler-with-cpp -E /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Preprocessor/assembler-with-cpp.c -o -
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck -strict-whitespace -check-prefix=CHECK-Identifiers-False /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Preprocessor/assembler-with-cpp.c
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Preprocessor/assembler-with-cpp.c:48:29: error: CHECK-Identifiers-False: expected string not found in input
# | // CHECK-Identifiers-False: 6: blarg $foo
# |                             ^
# | <stdin>:42:14: note: scanning from here
# | 5: expanded (
# |              ^
# | <stdin>:46:1: note: possible intended match here
# | 6: blarg$foo
# | ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Preprocessor/assembler-with-cpp.c
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |            37:  
# |            38:  
# |            39:  
# |            40:  
# |            41:  
# |            42: 5: expanded ( 
# | check:48'0                  X error: no match found
# |            43:  
# | check:48'0     ~
# |            44:  
# | check:48'0     ~
# |            45:  
# | check:48'0     ~
# |            46: 6: blarg$foo 
# | check:48'0     ~~~~~~~~~~~~~
# | check:48'1     ?             possible intended match
# |            47:  
# | check:48'0     ~
# |            48:  
# | check:48'0     ~
# |            49:  
# | check:48'0     ~
# |            50:  
# | check:48'0     ~
# |            51: 7: blarg$foo 
# | check:48'0     ~~~~~~~~~~~~~
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>

### Clang-Unit
<details>
<summary>Clang-Unit._/AllClangUnitTests/LexerTest/FindEndOfIdentifierContinuation</summary>

```
Script:
--
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/unittests/./AllClangUnitTests --gtest_filter=LexerTest.FindEndOfIdentifierContinuation
--
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/unittests/Lex/LexerTest.cpp:888
Expected equality of these values:
  Measure("ab$cd", 2)
    Which is: 3
  0u
    Which is: 0


```
</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/200614


More information about the cfe-commits mailing list