<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/67943>67943</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Dollar sign ('$') can not be encoded as a UCN inside an identifier
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
mattmanj17
</td>
</tr>
</table>
<pre>
Dollar signs are supported in identifiers as an extension,
but dollar signs encoded with a UCN do not work in identifiers.
For example, the file...
`gcc/testsuite/gcc.dg/ucnid-5.c`
...from the gcc test suite, does not compile.
Here is the contents of that file:
```
/* { dg-do run } */
/* { dg-skip-if "No dollar in identifiers" { avr-*-* powerpc-ibm-aix* } } */
/* { dg-options "-std=c99 -fdollars-in-identifiers -g" } */
void abort (void);
int a$b(void) { return 1; }
int main (void)
{
if (a\u0024b() != 1)
abort ();
return 0;
}
```
Godbolt link of it not compiling in clang 17.0.1
https://godbolt.org/z/TGdd9PoYx
Godbolt links for it compiling in gcc (and a previous clang version)
GCC 13.2 https://godbolt.org/z/TGdd9PoYx
clang 16 https://godbolt.org/z/xWfvKqvxz
Neither the C or C++ standards forbid using a UCN to encode '$'.
As far as I can tell they just forbid control chars, surrogates,
and chars in the 'basic character set', which does not include '$'.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVV2PqzYQ_TXOywhkTALLQx42ibKtKq360Krqo7EH8C7Y1DZJ7v31lQ3ZsKtW90oJEfHMOWfG88GdU61G3JPdgexOGz75ztj9wL0fuH7Lyk1t5Lf9yfQ9txBsHXCL4KZxNNajBKVBSdReNQqtA-6Aa8CbR-2U0YQdAQg9EfpcTx7kGge1MBIlXJXvgMOfx1eQBrTxcDX2_QtweoeZn2djAW98GHsMFL5DaFSPaZrezQraCkHY2aPzblIeCTu3QqSyJew8Ca1ksksFKegdOE3TxpohYrVCQHCExfMI0qCL2oQZxsC0VvMLWg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