<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 2000</TITLE>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<STYLE TYPE="text/css">
  INS { text-decoration:none; font-weight:bold; background-color:#A0FFA0 }
  .INS { text-decoration:none; background-color:#D0FFD0 }
  DEL { text-decoration:line-through; background-color:#FFA0A0 }
  .DEL { text-decoration:line-through; background-color: #FFD0D0 }
  @media (prefers-color-scheme: dark) {
    HTML { background-color:#202020; color:#f0f0f0; }
    A { color:#5bc0ff; }
    A:visited { color:#c6a8ff; }
    A:hover, a:focus { color:#afd7ff; }
    INS { background-color:#033a16; color:#aff5b4; }
    .INS { background-color: #033a16; }
    DEL { background-color:#67060c; color:#ffdcd7; }
    .DEL { background-color:#67060c; }
  }
  SPAN.cmnt { font-family:Times; font-style:italic }
</STYLE>
</HEAD>
<BODY>
<P><EM>This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21
  Core Issues List revision 118b.
  See http://www.open-std.org/jtc1/sc22/wg21/ for the official
  list.</EM></P>
<P>2025-09-28</P>
<HR>
<A NAME="2000"></A><H4>2000.
  
<I>header-name</I> outside <TT>#include</TT> directive
</H4>
<B>Section: </B>5.5&#160; [<A href="https://wg21.link/lex.pptoken">lex.pptoken</A>]
 &#160;&#160;&#160;

 <B>Status: </B>CD4
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2014-09-09<BR>


<P>[Moved to DR at the October, 2015 meeting.]</P>



<P>The &#8220;max munch&#8221; rule could be read to require the
characters <TT>&lt;int&gt;</TT> in <TT>vector&lt;int&gt;</TT> to
be parsed as a <I>header-name</I> rather than as three distinct
tokens.  5.6 [<A href="https://wg21.link/lex.header#1">lex.header</A>] paragraph 1 says,</P>

<BLOCKQUOTE>

Header name preprocessing tokens shall only appear within a
<TT>#include</TT> preprocessing directive
(15.3 [<A href="https://wg21.link/cpp.include">cpp.include</A>]).

</BLOCKQUOTE>

<P>However, that is not sufficiently clear that <I>header-name</I>s
are only to be recognized in that context.</P>

<P><B>Proposed resolution (May, 2015):</B></P>

<OL>
<LI><P>Change 5.5 [<A href="https://wg21.link/lex.pptoken#3.3">lex.pptoken</A>] bullet 3.3 as follows:</P></LI>

<UL>
<LI><P>Otherwise, the next preprocessing token is the longest
sequence of characters that could constitute a preprocessing
token, even if that would cause further lexical analysis to
fail<INS>, except that a <I>header-name</I> (5.6 [<A href="https://wg21.link/lex.header">lex.header</A>])
is only formed within a <TT>#include</TT> directive
(15.3 [<A href="https://wg21.link/cpp.include">cpp.include</A>])</INS>.</P></LI>

</UL>

<LI><P>Change 5.6 [<A href="https://wg21.link/lex.header#1">lex.header</A>] paragraph 1 as follows:</P></LI>

<BLOCKQUOTE>

<INS>[<I>Note:</I></INS> Header name preprocessing tokens
<DEL>shall</DEL> only appear within a <TT>#include</TT>
preprocessing directive (<DEL>15.3 [<A href="https://wg21.link/cpp.include">cpp.include</A>]</DEL>
<INS>see 5.5 [<A href="https://wg21.link/lex.pptoken">lex.pptoken</A>]</INS>). <INS>&#8212;<I>end
note</I>]</INS> The sequences in both forms...

</BLOCKQUOTE>

</OL>

<BR><BR>
</BODY>
</HTML>
