| Issue |
176897
|
| Summary |
Clang incorrectly rejects identifier using UCN identifier
|
| Labels |
clang
|
| Assignees |
|
| Reporter |
vrukesh
|
**What code / commands /steps will reproduce the problem?**
Compile the below sample code:
`
int \u0D3F;
int main() {
return \U00000D3f;
}
`
Compiler Explorer link: https://godbolt.org/z/8Pbh1GGEW
What is the expected result?
Compilation should be successful.
As per the standard, identifiers may contain universal-character-names that designate characters allowed by ISO/IEC TR 10176.
What happens instead?
g++ (GCC) compilation is successful.
Clang compilation fails with:
`
<source>:1:5: error: expected unqualified-id
1 | int \u0D3F;
| ^
<source>:4:12: error: expected _expression_
4 | return \U00000D3f;
| ^
2 errors generated.
Compiler returned: 1
`
This identifier should be accepted; Clang’s rejection appears non-conforming.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs