Title
header-name outside #include directive
Status
cd4
Section
5.4 [lex.pptoken]
Submitter
Richard Smith

Created on 2014-09-09.00:00:00 last changed 49 months ago

Messages

Date: 2015-10-15.00:00:00

[Moved to DR at the October, 2015 meeting.]

Date: 2015-05-15.00:00:00

Proposed resolution (May, 2015):

  1. Change 5.4 [lex.pptoken] bullet 3.3 as follows:

    • 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, except that a header-name (5.8 [lex.header]) is only formed within a #include directive (15.3 [cpp.include]).

  2. Change 5.8 [lex.header] paragraph 1 as follows:

  3. [Note: Header name preprocessing tokens shall only appear within a #include preprocessing directive (15.3 [cpp.include] see 5.4 [lex.pptoken]). end note] The sequences in both forms...
Date: 2014-09-09.00:00:00

The “max munch” rule could be read to require the characters <int> in vector<int> to be parsed as a header-name rather than as three distinct tokens. 5.8 [lex.header] paragraph 1 says,

Header name preprocessing tokens shall only appear within a #include preprocessing directive (15.3 [cpp.include]).

However, that is not sufficiently clear that header-names are only to be recognized in that context.

History
Date User Action Args
2017-02-06 00:00:00adminsetstatus: dr -> cd4
2015-11-10 00:00:00adminsetmessages: + msg6063
2015-11-10 00:00:00adminsetstatus: ready -> dr
2015-05-25 00:00:00adminsetmessages: + msg5443
2015-05-25 00:00:00adminsetstatus: drafting -> ready
2014-09-09 00:00:00admincreate