Issue |
132535
|
Summary |
Problems in token pasting
|
Labels |
new issue
|
Assignees |
|
Reporter |
kyuupichan
|
The token pasting code gets several tricky cases wrong. Consider the following for c++23:
#define concat1 \ ## Udeadbeef
concat1
#define concat2 R ## "averylongdelimiter()averylongdelimiter"
concat2
#define concat3 __VA_ARGS_ ## _
concat3
#define concat4 L'b' ## ud_suffix
concat4
#define concat5 R ## "aわ()aわ"
concat5
concat1 is invalid because the UCN is not a valid codepoint. Clang accepts it.
concat2 should diagnose the long raw literal delimiter. Clang does not.
concat3 should complain about an invalid use of __VA_ARGS__. Clang does not.
concat4 is a wide character literal with a user-defined suffix, clang rejects it saying a space is required. I believe it is valid.
concat5 contains an invalid character in the raw string delimiter, clang accepts it.
I used clang -E --std=c++23
$ clang --version
Apple clang version 16.0.0 (clang-1600.0.26.6)
Target: arm64-apple-darwin24.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs