Introduces support for `template for ( init; for-range-decl : expansion-init )`
which is a compile-time way to expand (iterate over):
- expansion expressions
- anything destructurable via structured bindings
- ranges with compile time size
It was sufficient to simply re-use the existing rule for
_for_range_loop_body for the part inside the parentheses, but add the
required sequence of `template` followed by `for`
Related to reflection, annotations use the same syntax as attributes,
but begin with an `=` and support any constant expression. Annotations
and Attributes can't be mixed within [[ ... ]].
This adds support for all the language changes introduced in P2996 which
was recently voted into the upcoming c++26 standard.
This includes:
- reflection expressions: the reflect operator (^^) followed by
expressions, type descriptors, or the global namespace (::)
- splice specifiers/expressions: [: expression :], which can appear as a
type, expression, alias descriptor, and more.
- consteval blocks: similar to static_asserts but have been introduced
specifically to allow constant evaluation side effects to occur at
specific places in code
- _block_item shouldn't contain module import/export/declarations as
they have to be top-level only
- This allows us to reuse _block_item as the rule for exportable items,
reducing our state count and parser size quite dramatically
This change allows operators (not just fields/member functions) as dependent
template expressions.
```cpp
auto x = y.template operator()<int>();
```
This syntax is used e.g. to call C++20 lambda expressions with a template head
where the template arguments are not function arguments and therefore cannot be
deduced.
```cpp
[]<typename> () {}.template operator()<int>();
```
This change allows commas inside subscripts.
```cpp
auto x = a[1, 2, 3];
```
From C++23, array subscripts work like arguments to `operator[]` as an n-ary
function.
Before C++23, `operator[]` must be a unary function, but before C++20, it's
possible to use the comma operator inside subscript expressions - and this is
done in libraries that use expression templates to achieve multidimensional
array syntax.
Use of the comma operator in subscript expressions was deprecated in C++20 to
make way for the C++23 change to n-ary `operator[]`.