|
Packit Service |
8bf002 |
/* u_1_22.t: Undefined behaviors on generating invalid pp-token by # and
|
|
Packit Service |
8bf002 |
## operators. */
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
/* u.1.22: Result of ## operator is not a valid pp-token. */
|
|
Packit Service |
8bf002 |
#define NUM( dig, exp) dig ## E+ ## exp
|
|
Packit Service |
8bf002 |
/*
|
|
Packit Service |
8bf002 |
* "E+" is a sequence of two pp-tokens "E" and "+", not a single pp-token.
|
|
Packit Service |
8bf002 |
* The first ## concatenates the last pp-token of first argument with "E",
|
|
Packit Service |
8bf002 |
* and the second ## concatenates "+" with the first pp-token of the second
|
|
Packit Service |
8bf002 |
* argument.
|
|
Packit Service |
8bf002 |
* While "12E" (one of the sequence generated by the token concatenation)
|
|
Packit Service |
8bf002 |
* is a valid pp-token, "+34" (the another sequence) is not a valid pp-token
|
|
Packit Service |
8bf002 |
* and causes an undefined behavior.
|
|
Packit Service |
8bf002 |
*/
|
|
Packit Service |
8bf002 |
NUM( 12, 34);
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
/* u.1.23: Result of # operator is not a valid string literal. */
|
|
Packit Service |
8bf002 |
/* "\\"\""; This sequence is parsed to three tokens "\\" \ "", and will be
|
|
Packit Service |
8bf002 |
diagnosed by compiler-proper unless diagnosed by preprocessor. */
|
|
Packit Service |
8bf002 |
#define str( a) #a
|
|
Packit Service |
8bf002 |
str( \"");
|
|
Packit Service |
8bf002 |
|