
Fixs https://github.com/llvm/llvm-project/issues/145240. The UCN in preprocessor pasted identifier not resolved to unicode, it may cause the following issue: ```c #define CAT(a,b) a##b char foo\u00b5; char*p = &CAT(foo, \u00b5); // error: use of undeclared identifier 'foo\u00b5' ``` The real identifier after paste is `fooµ`. This PR fix this issue in `TokenLexer::pasteTokens`, if there has any UCN in pasting tokens, the final pasted token should have a Token::HasUCN flag. Then `Preprocessor::LookUpIdentifierInfo` will expand UCNs in this token. Signed-off-by: yronglin <yronglin777@gmail.com>
11 lines
251 B
C
11 lines
251 B
C
// RUN: %clang_cc1 -fms-extensions %s -verify
|
|
// RUN: %clang_cc1 -E -fms-extensions %s | FileCheck %s
|
|
// expected-no-diagnostics
|
|
|
|
#define CAT(a,b) a##b
|
|
|
|
char foo\u00b5;
|
|
char*p = &CAT(foo, \u00b5);
|
|
// CHECK: char fooµ;
|
|
// CHECK-NEXT: char*p = &fooµ;
|