|
21 | 21 | %
|
22 | 22 | \begin{bnf}
|
23 | 23 | \nontermdef{try-block}\br
|
24 |
| - \terminal{try} compound-statement handler-seq |
| 24 | + \keyword{try} compound-statement handler-seq |
25 | 25 | \end{bnf}
|
26 | 26 |
|
27 | 27 | \indextext{\idxcode{try}}%
|
28 | 28 | %
|
29 | 29 | \begin{bnf}
|
30 | 30 | \nontermdef{function-try-block}\br
|
31 |
| - \terminal{try} \opt{ctor-initializer} compound-statement handler-seq |
| 31 | + \keyword{try} \opt{ctor-initializer} compound-statement handler-seq |
32 | 32 | \end{bnf}
|
33 | 33 |
|
34 | 34 | \begin{bnf}
|
|
40 | 40 | %
|
41 | 41 | \begin{bnf}
|
42 | 42 | \nontermdef{handler}\br
|
43 |
| - \terminal{catch} \terminal{(} exception-declaration \terminal{)} compound-statement |
| 43 | + \keyword{catch} \terminal{(} exception-declaration \terminal{)} compound-statement |
44 | 44 | \end{bnf}
|
45 | 45 |
|
46 | 46 | \begin{bnf}
|
|
101 | 101 | \indextext{\idxcode{return}!and handler}%
|
102 | 102 | \indextext{\idxcode{continue}!and handler}%
|
103 | 103 | A
|
104 |
| -\tcode{goto}, |
105 |
| -\tcode{break}, |
106 |
| -\tcode{return}, |
| 104 | +\keyword{goto}, |
| 105 | +\keyword{break}, |
| 106 | +\keyword{return}, |
107 | 107 | or
|
108 |
| -\tcode{continue} |
| 108 | +\keyword{continue} |
109 | 109 | statement can be used to transfer control out of
|
110 | 110 | a try block or handler.
|
111 | 111 | When this happens, each variable declared in the try block
|
|
197 | 197 | \grammarterm{throw-expression}{s}\iref{expr.throw},
|
198 | 198 | allocation functions\iref{basic.stc.dynamic.allocation},
|
199 | 199 | \keyword{dynamic_cast}\iref{expr.dynamic.cast},
|
200 |
| -\tcode{typeid}\iref{expr.typeid}, |
| 200 | +\keyword{typeid}\iref{expr.typeid}, |
201 | 201 | \grammarterm{new-expression}{s}\iref{expr.new}, and standard library
|
202 | 202 | functions\iref{structure.specifications}.
|
203 | 203 | \end{note}
|
|
210 | 210 | can be caught by a
|
211 | 211 | \grammarterm{handler}
|
212 | 212 | of
|
213 |
| -\tcode{const} |
214 |
| -\tcode{char*} |
| 213 | +\keyword{const} |
| 214 | +\tcode{\keyword{char}*} |
215 | 215 | type:
|
216 | 216 | \begin{codeblock}
|
217 | 217 | try {
|
|
252 | 252 | \grammarterm{compound-statement} or
|
253 | 253 | \grammarterm{ctor-initializer}
|
254 | 254 | following the
|
255 |
| -\tcode{try} |
| 255 | +\keyword{try} |
256 | 256 | keyword was most recently entered by the thread of control and not yet exited.
|
257 | 257 |
|
258 | 258 | \pnum
|
|
266 | 266 | If the type of the exception object would be
|
267 | 267 | an incomplete type,
|
268 | 268 | an abstract class type\iref{class.abstract},
|
269 |
| -or a pointer to an incomplete type other than \cv{}~\tcode{void} |
| 269 | +or a pointer to an incomplete type other than \cv{}~\keyword{void} |
270 | 270 | the program is ill-formed.
|
271 | 271 |
|
272 | 272 | \pnum
|
|
377 | 377 | constructed, but not yet destroyed,
|
378 | 378 | since the try block was entered.
|
379 | 379 | If an exception is thrown during the destruction of temporaries or
|
380 |
| -local variables for a \tcode{return} statement\iref{stmt.return}, |
| 380 | +local variables for a \keyword{return} statement\iref{stmt.return}, |
381 | 381 | the destructor for the returned object (if any) is also invoked.
|
382 | 382 | The objects are destroyed in the reverse order of the completion
|
383 | 383 | of their construction.
|
|
468 | 468 | The
|
469 | 469 | \grammarterm{exception-declaration}
|
470 | 470 | shall not denote a pointer or reference to an
|
471 |
| -incomplete type, other than ``pointer to \cv{}~\tcode{void}''. |
| 471 | +incomplete type, other than ``pointer to \cv{}~\keyword{void}''. |
472 | 472 |
|
473 | 473 | \pnum
|
474 | 474 | A handler of type
|
|
631 | 631 | on the initial function of the thread.
|
632 | 632 |
|
633 | 633 | \pnum
|
634 |
| -If a \tcode{return} statement\iref{stmt.return} appears in a handler of the |
| 634 | +If a \keyword{return} statement\iref{stmt.return} appears in a handler of the |
635 | 635 | \grammarterm{function-try-block}
|
636 | 636 | of a
|
637 | 637 | constructor, the program is ill-formed.
|
|
697 | 697 |
|
698 | 698 | \begin{bnf}
|
699 | 699 | \nontermdef{noexcept-specifier}\br
|
700 |
| - \terminal{noexcept} \terminal{(} constant-expression \terminal{)}\br |
701 |
| - \terminal{noexcept}\br |
| 700 | + \keyword{noexcept} \terminal{(} constant-expression \terminal{)}\br |
| 701 | + \keyword{noexcept}\br |
702 | 702 | \end{bnf}
|
703 | 703 |
|
704 | 704 | \pnum
|
705 | 705 | \indextext{exception specification!noexcept!constant expression and}%
|
706 | 706 | In a \grammarterm{noexcept-specifier}, the \grammarterm{constant-expression},
|
707 | 707 | if supplied, shall be a contextually converted constant expression
|
708 |
| -of type \tcode{bool}\iref{expr.const}; |
| 708 | +of type \keyword{bool}\iref{expr.const}; |
709 | 709 | that constant expression is the exception specification of
|
710 | 710 | the function type in which the \grammarterm{noexcept-specifier} appears.
|
711 |
| -A \tcode{(} token that follows \tcode{noexcept} is part of the |
| 711 | +A \tcode{(} token that follows \keyword{noexcept} is part of the |
712 | 712 | \grammarterm{noexcept-specifier} and does not commence an
|
713 | 713 | initializer\iref{dcl.init}.
|
714 |
| -The \grammarterm{noexcept-specifier} \tcode{noexcept} |
| 714 | +The \grammarterm{noexcept-specifier} \keyword{noexcept} |
715 | 715 | without a \grammarterm{constant-expression}
|
716 | 716 | is
|
717 | 717 | equivalent to the \grammarterm{noexcept-specifier}
|
718 |
| -\tcode{noexcept(true)}. |
| 718 | +\tcode{\keyword{noexcept}(\keyword{true})}. |
719 | 719 |
|
720 | 720 | \pnum
|
721 | 721 | If a declaration of a function
|
|
827 | 827 | requires a runtime check\iref{expr.dynamic.cast},
|
828 | 828 | or
|
829 | 829 | \item
|
830 |
| -$E$ is a \tcode{typeid} expression applied to a |
| 830 | +$E$ is a \keyword{typeid} expression applied to a |
831 | 831 | (possibly parenthesized) built-in unary \tcode{*} operator
|
832 | 832 | applied to a pointer to a
|
833 | 833 | polymorphic class type\iref{expr.typeid},
|
|
909 | 909 | };
|
910 | 910 | struct B {
|
911 | 911 | B() noexcept;
|
912 |
| - B(const B&) = default; // implicit exception specification is \tcode{noexcept(true)} |
| 912 | + B(const B&) = default; // implicit exception specification is \tcode{\keyword{noexcept}(\keyword{true})} |
913 | 913 | B(B&&, int = (throw 42, 0)) noexcept;
|
914 | 914 | ~B() noexcept(false);
|
915 | 915 | };
|
916 | 916 | int n = 7;
|
917 | 917 | struct D : public A, public B {
|
918 | 918 | int * p = new int[n];
|
919 |
| - // \tcode{D::D()} potentially-throwing, as the \tcode{new} operator may throw \tcode{bad_alloc} or \tcode{bad_array_new_length} |
| 919 | + // \tcode{D::D()} potentially-throwing, as the \keyword{new} operator may throw \tcode{bad_alloc} or \tcode{bad_array_new_length} |
920 | 920 | // \tcode{D::D(const D\&)} non-throwing
|
921 | 921 | // \tcode{D::D(D\&\&)} potentially-throwing, as the default argument for \tcode{B}'s constructor may throw
|
922 | 922 | // \tcode{D::\~D()} potentially-throwing
|
|
0 commit comments