Skip to content

Commit ed046ea

Browse files
committed
CWG3013 Disallowing macros for #embed parameters
1 parent 4726d67 commit ed046ea

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

source/preprocessor.tex

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,11 @@
275275
semantics.
276276

277277
\pnum
278+
If one of the \grammarterm{pp-tokens} of a \tcode{\#embed} directive
279+
(before macro replacement) is the \grammarterm{identifier}
280+
\tcode{limit}, \tcode{prefix}, \tcode{suffix}, or \tcode{if_empty}
281+
and that \grammarterm{identifier} is defined
282+
as a macro\iref{cpp.replace.general}, the program is ill-formed.
278283
Any \grammarterm{embed-prefixed-parameter} is conditionally-supported,
279284
with \impldef{supported forms of \#embed prefix parameters} semantics.
280285

@@ -525,6 +530,13 @@
525530
\tcode{defined}
526531
unary operator),
527532
just as in normal text.
533+
If replacement of macros in the preprocessing tokens following the sequence
534+
\tcode{\xname{has_embed} (} and before a matching \tcode{)}
535+
(possibly produced by macro expansion)
536+
encounters a preprocessing token that is one of the \grammarterm{identifier}s
537+
\tcode{limit}, \tcode{prefix}, \tcode{suffix}, or \tcode{if_empty}
538+
and that \grammarterm{identifier} is defined
539+
as a macro\iref{cpp.replace.general}, the program is ill-formed.
528540
If the preprocessing token
529541
\tcode{defined}
530542
is generated as a result of this replacement process

0 commit comments

Comments
 (0)