|
532 | 532 | \tcode{defined}
|
533 | 533 | unary operator does not match one of the two specified forms
|
534 | 534 | prior to macro replacement,
|
535 |
| -the behavior is undefined. |
| 535 | +the program is ill-formed, no diagnostic required. |
536 | 536 |
|
537 | 537 | \pnum
|
538 | 538 | After all replacements due to macro expansion and
|
|
746 | 746 | (i.e., each identifier currently defined as a macro name is replaced by its
|
747 | 747 | replacement list of preprocessing tokens).
|
748 | 748 | If the directive resulting after all replacements does not match
|
749 |
| -one of the two previous forms, the behavior is |
750 |
| -undefined. |
| 749 | +one of the two previous forms, the program is ill-formed, no diagnostic required. |
| 750 | + |
751 | 751 | \begin{note}
|
752 | 752 | Adjacent \grammarterm{string-literal}s are not concatenated into
|
753 | 753 | a single \grammarterm{string-literal}
|
|
1500 | 1500 | replacement list of preprocessing tokens are not considered
|
1501 | 1501 | part of the replacement list for either form of macro.
|
1502 | 1502 |
|
| 1503 | +\pnum |
| 1504 | +\indextext{unit!translation}% |
| 1505 | +A translation unit shall not \tcode{\#define} or \tcode{\#undef} |
| 1506 | +names lexically identical |
| 1507 | +to keywords, |
| 1508 | +to the identifiers listed in \tref{lex.name.special}, or |
| 1509 | +to the \grammarterm{attribute-token}{s} described in~\ref{dcl.attr}, |
| 1510 | +except that the names \tcode{likely} and \tcode{unlikely} may be |
| 1511 | +defined as function-like macros. |
| 1512 | + |
1503 | 1513 | \pnum
|
1504 | 1514 | If a
|
1505 | 1515 | \indextext{\#\#0 operator@\tcode{\#} operator}
|
|
1589 | 1599 | \begin{footnote}
|
1590 | 1600 | A \grammarterm{conditionally-supported-directive} is a preprocessing directive regardless of whether the implementation supports it.
|
1591 | 1601 | \end{footnote}
|
1592 |
| -the behavior is undefined. |
| 1602 | +the program is ill-formed. |
1593 | 1603 |
|
1594 | 1604 | \pnum
|
1595 | 1605 | \begin{example}
|
|
1783 | 1793 | Otherwise, the original spelling of each preprocessing token in the
|
1784 | 1794 | stringizing argument is retained in the character string literal,
|
1785 | 1795 | except for special handling for producing the spelling of
|
1786 |
| -\grammarterm{string-literal}s and \grammarterm{character-literal}s: |
1787 |
| -a |
1788 |
| -\tcode{\textbackslash} |
1789 |
| -character is inserted before each |
1790 |
| -\tcode{"} |
1791 |
| -and |
1792 |
| -\tcode{\textbackslash} |
1793 |
| -character of a \grammarterm{character-literal} or \grammarterm{string-literal} |
1794 |
| -(including the delimiting |
1795 |
| -\tcode{"} |
1796 |
| -characters). |
| 1796 | +\grammarterm{character-literal}s and \grammarterm{string-literal}s |
| 1797 | +(including the delimiting \unicode{0022}{quotation mark} (\tcode{"})) |
| 1798 | +contained within the preprocessing token: |
| 1799 | +a \unicode{005c}{reverse solidus} character (\tcode{\textbackslash}) |
| 1800 | +is inserted before each \unicode{0022}{quotation mark} and |
| 1801 | +\unicode{005c}{reverse solidus} character and each new-line character is |
| 1802 | +replaced by the two-character sequence \tcode{\textbackslash n}. |
1797 | 1803 | If the replacement that results is not a valid character string literal,
|
1798 |
| -the behavior is undefined. The character string literal corresponding to |
| 1804 | +the program is ill-formed. The character string literal corresponding to |
1799 | 1805 | an empty stringizing argument is \tcode{""}.
|
1800 | 1806 | The order of evaluation of
|
1801 | 1807 | \tcode{\#}
|
|
1844 | 1850 | a \grammarterm{universal-character-name}\iref{lex.charset}.
|
1845 | 1851 | \end{note}
|
1846 | 1852 | If the result is not a valid preprocessing token,
|
1847 |
| -the behavior is undefined. |
| 1853 | +the program is ill-formed. |
1848 | 1854 | The resulting preprocessing token is available for further macro replacement.
|
1849 | 1855 | The order of evaluation of
|
1850 | 1856 | \tcode{\#\#}
|
|
2055 | 2061 | by the digit sequence (interpreted as a decimal integer).
|
2056 | 2062 | If the digit sequence specifies zero
|
2057 | 2063 | or a number greater than 2147483647,
|
2058 |
| -the behavior is undefined. |
| 2064 | +the program is ill-formed. |
2059 | 2065 |
|
2060 | 2066 | \pnum
|
2061 | 2067 | A preprocessing directive of the form
|
|
2079 | 2085 | (each identifier currently defined as a macro name is replaced by its
|
2080 | 2086 | replacement list of preprocessing tokens).
|
2081 | 2087 | If the directive resulting after all replacements does not match
|
2082 |
| -one of the two previous forms, the behavior is undefined; |
| 2088 | +one of the two previous forms, the program is ill-formed; |
2083 | 2089 | otherwise, the result is processed as appropriate.
|
2084 | 2090 |
|
2085 | 2091 | \rSec1[cpp.error]{Diagnostic directives}%
|
|
2420 | 2426 | or a
|
2421 | 2427 | \tcode{\#undef}
|
2422 | 2428 | preprocessing directive,
|
2423 |
| -the behavior is undefined. |
| 2429 | +the program is ill-formed. |
2424 | 2430 | Any other predefined macro names shall begin with a
|
2425 | 2431 | leading underscore followed by an uppercase letter or a second
|
2426 | 2432 | underscore.
|
|
0 commit comments