Title
Are new/delete identifiers or preprocessing-op-or-punc?
Status
nad
Section
5.5 [lex.pptoken]
Submitter
Martin v. Loewis

Created on 2002-07-30.00:00:00 last changed 1 month ago

Messages

Date: 2025-10-15.00:00:00

Additional notes (October, 2025)

Paper P2843 (adopted in June, 2025) made it ill-formed to #define a macro that has the spelling of a keyword (15.7.1 [cpp.replace.general] paragraph 9). Subclause 5.8 [lex.operators] clearly specifies that the only textual preprocessing-op-or-punc are the alternative tokens.

Date: 2006-04-22.00:00:00

5.5 [lex.pptoken] paragraph 2 specifies that there are 5 categories of tokens in phases 3 to 6. With 5.8 [lex.operators] paragraph 1, it is unclear whether new is an identifier or a preprocessing-op-or-punc; likewise for delete. This is relevant to answer the question whether

#define delete foo

is a well-formed control-line, since that requires an identifier after the define token.

(See also issue 189.)

History
Date User Action Args
2025-10-28 21:40:00adminsetmessages: + msg8181
2025-10-28 21:40:00adminsetstatus: open -> nad
2025-03-05 21:47:19adminsetstatus: drafting -> open
2006-04-22 00:00:00adminsetstatus: open -> drafting
2002-07-30 00:00:00admincreate