Skip to content

Commit b2d34c4

Browse files
authored
Create lex_phases.md
1 parent a25b56b commit b2d34c4

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

lex_phases.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
- if a splice results in a character sequence that matches the syntax of a universal-character-name, the behavior is undefined. *\[lex.phases\]/p2*
2+
- Example from [Stacoverflow question](https://stackoverflow.com/q/43824729/1708801):
3+
4+
```cpp
5+
const char* p = "\\
6+
u0041";
7+
```
8+
9+
- Rationale
10+
- [DR 787](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#787)
11+
- [N3881 “Fixing the specification of universal-character-names”](http://open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3881.pdf)
12+
13+
- If a character sequence that matches the syntax of a universal-character-name is produced by token concatenation (19.3.3), the behavior is undefined. *\[lex.phases\]/p4*
14+
- example:
15+
16+
```cpp
17+
#define GUARD_NAME ï ## _GUARD // UB per current spec
18+
#define COLUMN "ï" ## _column // UB per current spec
19+
```
20+
21+
- Rationale
22+
- [DR 787](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#787)
23+
- [N3881 “Fixing the specification of universal-character-names”](http://open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3881.pdf)
24+

0 commit comments

Comments
 (0)