Title
Destringizing for raw string literals
Status
open
Section
15.13 [cpp.pragma.op]
Submitter
CA

Created on 2025-10-01.00:00:00 last changed 1 month ago

Messages

Date: 2025-11-06.23:04:52

CWG 2025-10-24

There is no consensus to disallow raw string literals in the pragma operator in the C++26 cycle. This core issue is kept open to facilitate further discussion for future C++ releases.

Date: 2025-11-06.23:04:52

Possible resolution:

Change in 15.13 [cpp.pragma.op] paragraph 1 as follows:

A unary operator expression of the form:
  _Pragma ( string-literal )
is processed as follows: The string-literal shall not be a raw string literal (5.13.5 [lex.string]). The string-literal is destringized by deleting the L prefix, if present, deleting the leading and trailing double-quotes, replacing each escape sequence \" by a double-quote, and replacing each escape sequence \\ by a single backslash. The resulting sequence of characters is processed through translation phase 3 to produce preprocessing tokens that are executed as if they were the pp-tokens in a pragma directive. The original four preprocessing tokens in the unary operator expression are removed.
Date: 2025-11-06.23:04:52
N5028 comment CA 111

The destringizing mechansim omits any treatment of the d-char-sequence of a raw string literal.

History
Date User Action Args
2025-11-06 23:04:52adminsetmessages: + msg8370
2025-10-24 19:41:57adminsetmessages: + msg8171
2025-10-01 00:00:00admincreate