|
543 | 543 | \tcode{defined}
|
544 | 544 | unary operator does not match one of the two specified forms
|
545 | 545 | prior to macro replacement,
|
546 |
| -the behavior is undefined. |
| 546 | +the program is ill-formed, no diagnostic required. |
547 | 547 |
|
548 | 548 | \pnum
|
549 | 549 | After all replacements due to macro expansion and
|
|
764 | 764 | is \impldef{treatment of whitespace when processing a \tcode{\#include} directive}.
|
765 | 765 | If the attempt succeeds, the directive with the so-formed \grammarterm{header-name}
|
766 | 766 | is processed as specified for the previous form.
|
767 |
| -Otherwise, the behavior is undefined. |
| 767 | +Otherwise, the program is ill-formed, no diagnostic required. |
768 | 768 | \begin{note}
|
769 | 769 | Adjacent \grammarterm{string-literal}s are not concatenated into
|
770 | 770 | a single \grammarterm{string-literal}
|
|
1529 | 1529 | replacement list of preprocessing tokens are not considered
|
1530 | 1530 | part of the replacement list for either form of macro.
|
1531 | 1531 |
|
| 1532 | +\pnum |
| 1533 | +\indextext{unit!translation}% |
| 1534 | +A translation unit shall not \tcode{\#define} or \tcode{\#undef} |
| 1535 | +names lexically identical |
| 1536 | +to keywords, |
| 1537 | +to the identifiers listed in \tref{lex.name.special}, or |
| 1538 | +to the \grammarterm{attribute-token}{s} described in~\ref{dcl.attr}, |
| 1539 | +except that the names \tcode{likely} and \tcode{unlikely} may be |
| 1540 | +defined as function-like macros. |
| 1541 | + |
1532 | 1542 | \pnum
|
1533 | 1543 | If a
|
1534 | 1544 | \indextext{\#\#0 operator@\tcode{\#} operator}
|
|
1618 | 1628 | \begin{footnote}
|
1619 | 1629 | A \grammarterm{conditionally-supported-directive} is a preprocessing directive regardless of whether the implementation supports it.
|
1620 | 1630 | \end{footnote}
|
1621 |
| -the behavior is undefined. |
| 1631 | +the program is ill-formed. |
1622 | 1632 |
|
1623 | 1633 | \pnum
|
1624 | 1634 | \begin{example}
|
|
1813 | 1823 | stringizing argument is retained in the character string literal,
|
1814 | 1824 | except for special handling for producing the spelling of
|
1815 | 1825 | \grammarterm{header-name}s,
|
1816 |
| -\grammarterm{string-literal}s, |
1817 |
| -and \grammarterm{character-literal}s: |
1818 |
| -a \tcode{\textbackslash} character is inserted before each |
1819 |
| -\tcode{"} and \tcode{\textbackslash} character of a |
| 1826 | +\grammarterm{character-literal}s, |
| 1827 | +and \grammarterm{string-literal}s |
| 1828 | +(including the delimiting \unicode{0022}{quotation mark} (\tcode{"})) |
| 1829 | +contained within the preprocessing token: |
| 1830 | +a \unicode{005c}{reverse solidus} character (\tcode{\textbackslash}) |
| 1831 | +is inserted before each \unicode{0022}{quotation mark} and |
| 1832 | +\unicode{005c}{reverse solidus} character of a |
1820 | 1833 | \grammarterm{header-name},
|
1821 | 1834 | \grammarterm{character-literal},
|
1822 |
| -or \grammarterm{string-literal} |
1823 |
| -(including the delimiting \tcode{"} characters). |
| 1835 | +or \grammarterm{string-literal}, |
| 1836 | +and each new-line character is |
| 1837 | +replaced by the two-character sequence \tcode{\textbackslash n}. |
1824 | 1838 | If the replacement that results is not a valid character string literal,
|
1825 |
| -the behavior is undefined. The character string literal corresponding to |
| 1839 | +the program is ill-formed. |
| 1840 | +The character string literal corresponding to |
1826 | 1841 | an empty stringizing argument is \tcode{""}.
|
1827 | 1842 | The order of evaluation of
|
1828 | 1843 | \tcode{\#}
|
|
1871 | 1886 | a \grammarterm{universal-character-name}\iref{lex.charset}.
|
1872 | 1887 | \end{note}
|
1873 | 1888 | If the result is not a valid preprocessing token,
|
1874 |
| -the behavior is undefined. |
| 1889 | +the program is ill-formed. |
1875 | 1890 | The resulting preprocessing token is available for further macro replacement.
|
1876 | 1891 | The order of evaluation of
|
1877 | 1892 | \tcode{\#\#}
|
|
2082 | 2097 | by the digit sequence (interpreted as a decimal integer).
|
2083 | 2098 | If the digit sequence specifies zero
|
2084 | 2099 | or a number greater than 2147483647,
|
2085 |
| -the behavior is undefined. |
| 2100 | +the program is ill-formed. |
2086 | 2101 |
|
2087 | 2102 | \pnum
|
2088 | 2103 | A preprocessing directive of the form
|
|
2106 | 2121 | (each identifier currently defined as a macro name is replaced by its
|
2107 | 2122 | replacement list of preprocessing tokens).
|
2108 | 2123 | If the directive resulting after all replacements does not match
|
2109 |
| -one of the two previous forms, the behavior is undefined; |
| 2124 | +one of the two previous forms, the program is ill-formed; |
2110 | 2125 | otherwise, the result is processed as appropriate.
|
2111 | 2126 |
|
2112 | 2127 | \rSec1[cpp.error]{Diagnostic directives}%
|
|
2450 | 2465 | or a
|
2451 | 2466 | \tcode{\#undef}
|
2452 | 2467 | preprocessing directive,
|
2453 |
| -the behavior is undefined. |
| 2468 | +the program is ill-formed. |
2454 | 2469 | Any other predefined macro names shall begin with a
|
2455 | 2470 | leading underscore followed by an uppercase letter or a second
|
2456 | 2471 | underscore.
|
|
0 commit comments