diff options
Diffstat (limited to 'doc/misc/cc-mode.texi')
-rw-r--r-- | doc/misc/cc-mode.texi | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi index 3a808619868..71bf3fcee4a 100644 --- a/doc/misc/cc-mode.texi +++ b/doc/misc/cc-mode.texi @@ -330,6 +330,7 @@ Syntactic Symbols * Multiline Macro Symbols:: * Objective-C Method Symbols:: * Java Symbols:: +* Constraint Symbols:: * Statement Block Symbols:: * K&R Symbols:: @@ -4234,6 +4235,9 @@ The first line in a ``topmost'' definition. @ref{Function Symbols}. Topmost definition continuation lines. This is only used in the parts that aren't covered by other symbols such as @code{func-decl-cont} and @code{knr-argdecl}. @ref{Function Symbols}. +@item constraint-cont +Continuation line of a topmost C++20 concept or requires clause. +@ref{Constraint Symbols}. @item annotation-top-cont Topmost definition continuation lines where all previous items are annotations. @ref{Java Symbols}. @@ -4397,6 +4401,7 @@ Java. @ref{Java Symbols}. * Multiline Macro Symbols:: * Objective-C Method Symbols:: * Java Symbols:: +* Constraint Symbols:: * Statement Block Symbols:: * K&R Symbols:: @end menu @@ -5071,6 +5076,39 @@ syntax due to it being a continuation of a variable declaration where preceding the declaration is an annotation. @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +@node Constraint Symbols +@subsection C++ Constraint Symbols +@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +The C++20 standard introduced the notion of @dfn{concepts} and +@dfn{requirements}, a typical instance of which looks something like +this: + +@example + 1: template <typename T> + 2: requires + 3: requires (T t) @{ + 4: @{ ++t; @} + 5: @} + 6: && std::is_integral<T> + 7: int foo(); +@end example + +@ssindex constraint-cont +Line 1 is assigned the familiar @code{topmost-intro}. Line 2 gets +@code{topmost-intro-cont}, being the keyword which introduces a +@dfn{requires clause}. Lines 3, 6, and 7 are assigned the syntax +@code{constraint-cont}, being continuations of the requires clause +started on line 2. Lines 4 and 5 get the syntaxes +@code{defun-block-intro} and @code{defun-close}, being analyzed as +though part of a function. + +Note that the @code{requires} on Line 3 begins a @dfn{requires +expression}, not a a requires clause, hence its components are not +assigned @code{constraint-cont}. See +@url{https://en.cppreference.com/w/cpp/language/requires}. + +@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @node Statement Block Symbols @subsection Statement Block Symbols @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |