mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-10-04 16:56:55 +02:00
Add a guarded "C++ 26 extensions" block (cpp_no_cpp26) covering new
lexical surface introduced since C++23:
- [[ ... ]] attributes as a region, so P3394 annotations carrying a
value expression (eg [[=foo{1}]]) no longer trip cErrInBracket on
their braces/parens. A \w\@1<! look-behind keeps it from matching a
subscripted immediately-invoked lambda (arr[[]{...}()]).
- ^^ reflection operator (P2996).
- [: :] splice brackets (P2996).
- contract_assert keyword (P2900).
Add input/cpp_cpp26.cpp exercising these constructs with screendumps,
and update dumps/cpp_noreturn_00.dump for the new [[ ]] attribute
delimiter highlighting.
closes: #20577
Signed-off-by: Gareth Lloyd <gareth@ignition-web.co.uk>
Signed-off-by: Christian Brabandt <cb@256bit.org>
14 lines
399 B
C++
14 lines
399 B
C++
// C++26 lexical constructs
|
|
|
|
// P3394 annotations: [[ ... ]] may carry a value expression.
|
|
[[=rename{"full_name"}]] int braced;
|
|
[[=key(8)]] int parened;
|
|
[[nodiscard]] int plain();
|
|
|
|
// P2900 contracts: contract_assert is a keyword.
|
|
void check(int x) { contract_assert(x != 0); }
|
|
|
|
// P2996 reflection (^^) and splicing ([: :]).
|
|
constexpr auto refl = ^^int;
|
|
[:refl:] spliced{};
|