|
3523 | 3523 | \end{bnf} |
3524 | 3524 |
|
3525 | 3525 | \pnum |
3526 | | -A |
3527 | | -\grammarterm{splice-specifier} or \grammarterm{splice-specialization-specifier} |
| 3526 | +A \grammarterm{splice-specifier} |
| 3527 | +or \grammarterm{splice-specialization-specifier} |
3528 | 3528 | immediately followed by \tcode{::} or preceded by \keyword{typename} |
3529 | 3529 | is never interpreted as part of a \grammarterm{splice-expression}. |
3530 | 3530 | \begin{example} |
|
3540 | 3540 | constexpr auto g = typename [:^^int:](42); // OK, \tcode{typename [:\caret\caret int:]} is a \grammarterm{splice-type-specifier} |
3541 | 3541 |
|
3542 | 3542 | constexpr auto h = ^^g; |
3543 | | -constexpr auto i = e<[:^^h:]>; // error: unparenthesized \grammarterm{splice-expression} used as template argument |
3544 | | -constexpr auto j = e<([:^^h:])>; // OK |
| 3543 | +constexpr auto i = e<[:^^h:]>; // error: unparenthesized \grammarterm{splice-expression} used as template argument |
| 3544 | +constexpr auto j = e<([:^^h:])>; // OK |
3545 | 3545 | \end{codeblock} |
3546 | 3546 | \end{example} |
3547 | 3547 |
|
|
8972 | 8972 |
|
8973 | 8973 | constexpr Derived obj{.r=^^::}; // OK |
8974 | 8974 | constexpr const Derived& d = obj; // OK |
8975 | | -constexpr const Base& b = fn(obj); // error: not a constant expression because \tcode{Derived} is a consteval-only type but \tcode{Base} is not. |
| 8975 | +constexpr const Base& b = fn(obj); // error: not a constant expression because \tcode{Derived} |
| 8976 | + // is a consteval-only type but \tcode{Base} is not. |
8976 | 8977 | \end{codeblock} |
8977 | 8978 | \end{example} |
8978 | 8979 | \end{itemize} |
|
9292 | 9293 | \begin{codeblock} |
9293 | 9294 | struct S0 { |
9294 | 9295 | consteval { |
9295 | | - std::meta::define_aggregate(^^S0, {}); // error: scope associated with S0 encloses the consteval block |
| 9296 | + std::meta::define_aggregate(^^S0, {}); // error: scope associated with \tcode{S0} encloses the consteval block |
9296 | 9297 | } |
9297 | 9298 | }; |
9298 | 9299 |
|
|
9333 | 9334 | struct S6; |
9334 | 9335 | consteval { // \#1 |
9335 | 9336 | struct S7; // local class |
9336 | | - std::meta::define_aggregate(^^S7, {}); |
9337 | | - // error: consteval block \#1 does not enclose itself, but encloses \tcode{S7} |
| 9337 | + |
| 9338 | + std::meta::define_aggregate(^^S7, {}); // error: consteval block \#1 does not enclose itself, |
| 9339 | + // but encloses \tcode{S7} |
| 9340 | + |
9338 | 9341 | consteval { // \#2 |
9339 | | - std::meta::define_aggregate(^^S6, {}); |
9340 | | - // error: consteval block \#1 encloses consteval block \#2 but not \tcode{S6} |
| 9342 | + std::meta::define_aggregate(^^S6, {}); // error: consteval block \#1 encloses |
| 9343 | + // consteval block \#2 but not \tcode{S6} |
| 9344 | + |
9341 | 9345 | std::meta::define_aggregate(^^S7, {}); // OK, consteval block \#1 encloses both \#2 and \tcode{S7} |
9342 | 9346 | } |
9343 | 9347 | } |
|
0 commit comments