Skip to content

[Clang] UCN in preprocessor-pasted identifier not resolved to unicode #145240

@fuhsnn

Description

@fuhsnn

With the snippet:

#define CAT(a,b) a##b

char foo\u00b5;
char*p = &CAT(foo, \u00b5);

Clang resolves the variable name as "fooµ", and the concatenated reference to it next line as "foo\u00b5", then error on undeclared reference. Other implementations instead treat both the same: https://godbolt.org/z/M1fejPK36

Wasn't encountered in real world, just a what-if test I came up for my implementation.

Metadata

Metadata

Assignees

Labels

clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions