diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 4e4a7b4658..33bae966a7 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -777,6 +777,7 @@ cpp_no_cpp14 don't highlight C++14 standard items cpp_no_cpp17 don't highlight C++17 standard items cpp_no_cpp20 don't highlight C++20 standard items cpp_no_cpp23 don't highlight C++23 standard items +cpp_no_cpp26 don't highlight C++26 standard items CSH *ft-csh-syntax* diff --git a/runtime/syntax/cpp.vim b/runtime/syntax/cpp.vim index 1c725a4bfd..121eab2c6f 100644 --- a/runtime/syntax/cpp.vim +++ b/runtime/syntax/cpp.vim @@ -110,6 +110,15 @@ if !exists("cpp_no_cpp23") syn keyword cppType float16_t float32_t float64_t float128_t bfloat16_t endif +" C++ 26 extensions +if !exists("cpp_no_cpp26") + " attribute [[ ... ]] with optional value expr, eg [[=foo{1}]] + syn region cppAttribute matchgroup=cppAttributeBracket start="\w\@1]?" @@ -134,6 +143,9 @@ hi def link cppString String hi def link cppNumber Number hi def link cppFloat Number hi def link cppModule Include +hi def link cppAttributeBracket Special +hi def link cppReflect Operator +hi def link cppSpliceBracket Special let b:current_syntax = "cpp"