Skip to content

Commit 3140e5f

Browse files
eisenwavetkoeppe
authored andcommitted
CWG3078 Different treatment of #include pp-tokens and header-name-tokens
1 parent a4bc63f commit 3140e5f

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

source/lex.tex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -831,11 +831,11 @@
831831
\pnum
832832
In all respects of the language, each alternative token behaves the
833833
same, respectively, as its primary token, except for its spelling.
834-
\begin{footnote}
835-
Thus the ``stringized'' values\iref{cpp.stringize} of
836-
\tcode{[} and \tcode{<:} will be different, maintaining the source
837-
spelling, but the tokens can otherwise be freely interchanged.
838-
\end{footnote}
834+
\begin{note}
835+
The ``stringized'' values\iref{cpp.stringize} of
836+
\tcode{[} and \tcode{<:} are different,
837+
maintaining the source spelling.
838+
\end{note}
839839
The set of alternative tokens is defined in
840840
\tref{lex.digraph}.
841841

source/preprocessor.tex

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@
353353

354354
\begin{bnf}
355355
\nontermdef{header-name-tokens}\br
356-
string-literal\br
356+
plain-string-literal\br
357357
\terminal{<} h-pp-tokens \terminal{>}
358358
\end{bnf}
359359

@@ -756,12 +756,13 @@
756756
in the directive are processed just as in normal text
757757
(i.e., each identifier currently defined as a macro name is replaced by its
758758
replacement list of preprocessing tokens).
759-
After replacement,
760-
if the first preprocessing token is a \grammarterm{string-literal},
761-
it shall be a \grammarterm{plain-string-literal}.
762-
Then, an attempt is made to form a \grammarterm{header-name}
759+
The resulting sequence of preprocessing tokens shall be of the form
760+
\begin{ncsimplebnf}
761+
header-name-tokens
762+
\end{ncsimplebnf}
763+
An attempt is then made to form a \grammarterm{header-name}
763764
preprocessing token\iref{lex.header} from the whitespace and the characters
764-
of the spellings of the resulting sequence of preprocessing tokens;
765+
of the spellings of the \grammarterm{header-name-tokens};
765766
the treatment of whitespace
766767
is \impldef{treatment of whitespace when processing a \tcode{\#include} directive}.
767768
If the attempt succeeds, the directive with the so-formed \grammarterm{header-name}

0 commit comments

Comments
 (0)