diff --git a/source/access.tex b/source/access.tex index f84fd8b4d0..bd15b5e7f2 100644 --- a/source/access.tex +++ b/source/access.tex @@ -88,8 +88,8 @@ }; void f() { - A::BB x; // OK, typedef name \tcode{A::BB} is public - A::B y; // access error, \tcode{A::B} is private + A::BB x; // OK: typedef name \tcode{A::BB} is public + A::B y; // access error: \tcode{A::B} is private } \end{codeblock} \end{note} @@ -187,7 +187,7 @@ template class D : public U { }; -D >* d; // access error, C::TT is protected +D >* d; // access error: C::TT is protected \end{codeblock} \end{example} @@ -657,7 +657,7 @@ }; class Y { - int v[X::a]; // OK, \tcode{Y} is a friend of \tcode{X} + int v[X::a]; // OK: \tcode{Y} is a friend of \tcode{X} }; class Z { @@ -842,13 +842,13 @@ class A { friend class X; // OK, but \tcode{X} is a local class, not \tcode{::X} friend class Y; // OK - friend class Z; // OK, introduces local class \tcode{Z} - friend void a(); // error, \tcode{::a} is not considered + friend class Z; // OK: introduces local class \tcode{Z} + friend void a(); // error: \tcode{::a} is not considered friend void b(); // OK friend void c(); // error }; X* px; // OK, but \tcode{::X} is found - Z* pz; // error, no \tcode{Z} is found + Z* pz; // error: no \tcode{Z} is found } \end{codeblock} \end{example} diff --git a/source/basic.tex b/source/basic.tex index bc032ecb79..cf7a3296c8 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -914,7 +914,7 @@ class X { char v[i]; // error: \tcode{i} refers to \tcode{::i} // but when reevaluated is \tcode{X::i} - int f() { return sizeof(c); } // OK: \tcode{X::c} + int f() { return sizeof(c); } // OK: \tcode{X::c} char c; enum { i = 2 }; }; @@ -1753,7 +1753,7 @@ B::B() { } B::A ba; // object of type \tcode{A} -A::A a; // error, \tcode{A::A} is not a type name +A::A a; // error: \tcode{A::A} is not a type name struct A::A a2; // object of type \tcode{A} \end{codeblock} \end{example} @@ -1949,8 +1949,8 @@ namespace C { using namespace A; using namespace B; - int i = C::x; // OK, \tcode{A::x} (of type \tcode{int} ) - int j = C::y; // ambiguous, \tcode{A::y} or \tcode{B::y} + int i = C::x; // OK: \tcode{A::x} (of type \tcode{int} ) + int j = C::y; // ambiguous: \tcode{A::y} or \tcode{B::y} } \end{codeblock} \end{example} @@ -1977,7 +1977,7 @@ } using namespace B; } -void A::f1(int){ } // ill-formed, \tcode{f1} is not a member of \tcode{A} +void A::f1(int){ } // ill-formed: \tcode{f1} is not a member of \tcode{A} \end{codeblock} \end{example} However, in such namespace member declarations, the @@ -2000,7 +2000,7 @@ using namespace A; using namespace C::D; -void B::f1(int){ } // OK, defines \tcode{A::B::f1(int)} +void B::f1(int){ } // OK: defines \tcode{A::B::f1(int)} \end{codeblock} \end{example} \indextext{lookup!qualified~name|)}% @@ -3325,7 +3325,7 @@ void B::mutate() { new (this) D2; // reuses storage --- ends the lifetime of \tcode{*this} f(); // undefined behavior - ... = this; // OK, \tcode{this} points to valid memory + ... = this; // OK: \tcode{this} points to valid memory } void g() { @@ -3594,7 +3594,7 @@ X x; void bar() { - xp = &x; // OK; type is ``pointer to \tcode{X}'' + xp = &x; // OK: type is ``pointer to \tcode{X}'' arrp = &arr; // ill-formed: different types xp++; // OK: \tcode{X} is complete arrp++; // ill-formed: \tcode{UNKA} can't be completed diff --git a/source/classes.tex b/source/classes.tex index 6a93cb9668..f184fd4a4e 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -316,7 +316,7 @@ \begin{codeblock} struct S { int a; }; -struct S { int a; }; // error, double definition +struct S { int a; }; // error: double definition \end{codeblock} is ill-formed because it defines \tcode{S} twice. @@ -781,7 +781,7 @@ union U { T1 t1; T2 t2; }; int f() { U u = { { 1, 2 } }; // active member is \tcode{t1} - return u.t2.c; // OK, as if \tcode{u.t1.a} were nominated + return u.t2.c; // OK: as if \tcode{u.t1.a} were nominated } \end{codeblock} \end{example} @@ -1635,7 +1635,7 @@ struct X { const int a; int b; }; union Y { X x; int k; }; void g() { - Y y = { { 1, 2 } }; // OK, \tcode{y.x} is active union member (\ref{class.mem}) + Y y = { { 1, 2 } }; // OK: \tcode{y.x} is active union member (\ref{class.mem}) int n = y.x.a; y.k = 4; // OK: ends lifetime of \tcode{y.x}, \tcode{y.k} is active member of union y.x.b = n; // undefined behavior: \tcode{y.x.b} modified outside its lifetime, diff --git a/source/compatibility.tex b/source/compatibility.tex index 782a1dcb8a..bab5224933 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -1578,12 +1578,12 @@ struct derived; struct base { friend struct derived; -private: +private: base(); }; struct derived : base {}; -derived d1{}; // Error. The code was well-formed before. +derived d1{}; // error: the code was well-formed before. derived d2; // still OK \end{codeblock} diff --git a/source/conversions.tex b/source/conversions.tex index 5a9799346c..075cc9020d 100644 --- a/source/conversions.tex +++ b/source/conversions.tex @@ -154,7 +154,7 @@ } auto g = f(); int m = g(false); // undefined behavior due to access of \tcode{x.n} outside its lifetime -int n = g(true); // OK, does not access \tcode{y.n} +int n = g(true); // OK: does not access \tcode{y.n} \end{codeblock} \end{example} The result of the conversion is determined according to the @@ -231,7 +231,7 @@ \begin{example} \begin{codeblock} struct X { int n; }; -int k = X().n; // OK, \tcode{X()} prvalue is converted to xvalue +int k = X().n; // OK: \tcode{X()} prvalue is converted to xvalue \end{codeblock} \end{example} diff --git a/source/declarations.tex b/source/declarations.tex index f76b0fb30d..9082661c2e 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -154,7 +154,7 @@ \begin{codeblock} enum { }; // ill-formed -typedef class { }; // ill-formed +typedef class { }; // ill-formed \end{codeblock} \end{example} @@ -1466,7 +1466,7 @@ -> decltype((h())); // does not force completion of \tcode{A}; \tcode{A::\~{}A()} is // not implicitly used within the context of this \grammarterm{decltype-specifier} void r() { - q(42); // Error: deduction against \tcode{q} succeeds, so overload resolution + q(42); // error: deduction against \tcode{q} succeeds, so overload resolution // selects the specialization ``\tcode{q(T) -> decltype((h())) [with T=int]}''. // The return type is \tcode{A}, so a temporary is introduced and its // destructor is used, so the program is ill-formed. @@ -1678,7 +1678,7 @@ \begin{example} \begin{codeblock} auto f() { } // OK, return type is \tcode{void} -auto* g() { } // error, cannot deduce \tcode{auto*} from \tcode{void()} +auto* g() { } // error: cannot deduce \tcode{auto*} from \tcode{void()} \end{codeblock} \end{example} @@ -1690,14 +1690,14 @@ \tcode{return} statements. \begin{example} \begin{codeblock} -auto n = n; // error, \tcode{n}'s type is unknown +auto n = n; // error: \tcode{n}'s type is unknown auto f(); -void g() { &f; } // error, \tcode{f}'s return type is unknown +void g() { &f; } // error: \tcode{f}'s return type is unknown auto sum(int i) { if (i == 1) return i; // \tcode{sum}'s return type is \tcode{int} else - return sum(i-1)+i; // OK, \tcode{sum}'s return type has been deduced + return sum(i-1)+i; // OK: \tcode{sum}'s return type has been deduced } \end{codeblock} \end{example} @@ -1729,19 +1729,19 @@ auto f(); auto f() { return 42; } // return type is \tcode{int} auto f(); // OK -int f(); // error, cannot be overloaded with \tcode{auto f()} -decltype(auto) f(); // error, \tcode{auto} and \tcode{decltype(auto)} don't match +int f(); // error: cannot be overloaded with \tcode{auto f()} +decltype(auto) f(); // error: \tcode{auto} and \tcode{decltype(auto)} don't match template auto g(T t) { return t; } // \#1 template auto g(int); // OK, return type is \tcode{int} -template char g(char); // error, no matching template -template<> auto g(double); // OK, forward declaration with unknown return type +template char g(char); // error: no matching template +template<> auto g(double); // OK: forward declaration with unknown return type -template T g(T t) { return t; } // OK, not functionally equivalent to \#1 -template char g(char); // OK, now there is a matching template +template T g(T t) { return t; } // OK: not functionally equivalent to \#1 +template char g(char); // OK: now there is a matching template template auto g(float); // still matches \#1 -void h() { return g(42); } // error, ambiguous +void h() { return g(42); } // error: ambiguous template struct A { friend T frf(T); @@ -1877,9 +1877,9 @@ auto x5a = f(); // \tcode{decltype(x5a)} is \tcode{int} decltype(auto) x5d = f(); // \tcode{decltype(x5d)} is \tcode{int\&\&} auto x6a = { 1, 2 }; // \tcode{decltype(x6a)} is \tcode{std::initializer_list} -decltype(auto) x6d = { 1, 2 }; // error, \tcode{\{ 1, 2 \}} is not an expression +decltype(auto) x6d = { 1, 2 }; // error: \tcode{\{ 1, 2 \}} is not an expression auto *x7a = &i; // \tcode{decltype(x7a)} is \tcode{int*} -decltype(auto)*x7d = &i; // error, declared type is not plain \tcode{decltype(auto)} +decltype(auto)*x7d = &i; // error: declared type is not plain \tcode{decltype(auto)} \end{codeblock} \end{example} @@ -1915,9 +1915,9 @@ container(Iter b, Iter e) -> container::value_type>; std::vector v = { /* ... */}; -container c(7); // OK, deduces \tcode{int} for \tcode{T} -auto d = container(v.begin(), v.end()); // OK, deduces \tcode{double} for \tcode{T} -container e{5, 6}; // error, \tcode{int} is not an iterator +container c(7); // OK: deduces \tcode{int} for \tcode{T} +auto d = container(v.begin(), v.end()); // OK: deduces \tcode{double} for \tcode{T} +container e{5, 6}; // error: \tcode{int} is not an iterator \end{codeblock} \end{example} @@ -3195,14 +3195,14 @@ } using namespace A::B::C; void f1() { - i = 5; // OK, \tcode{C::i} visible in \tcode{B} and hides \tcode{A::i} + i = 5; // OK: \tcode{C::i} visible in \tcode{B} and hides \tcode{A::i} } } namespace D { using namespace B; using namespace C; void f2() { - i = 5; // ambiguous, \tcode{B::C::i} or \tcode{A::i}? + i = 5; // ambiguous: \tcode{B::C::i} or \tcode{A::i}? } } void f3() { @@ -3349,7 +3349,7 @@ } void f() { - d1++; // error: ambiguous \tcode{::d1} or \tcode{D::d1}? + d1++; // error: ambiguous: \tcode{::d1} or \tcode{D::d1}? ::d1++; // OK D::d1++; // OK d2++; // OK: \tcode{D::d2} @@ -3580,7 +3580,7 @@ namespace B { extern "C" int f(); // \tcode{A::f} and \tcode{B::f} refer to the same function - extern "C" int g() { return 1; } // ill-formed, the function \tcode{g} + extern "C" int g() { return 1; } // ill-formed: the function \tcode{g} // with C language linkage has two definitions } @@ -3851,7 +3851,7 @@ struct alignas(8) S {}; struct alignas(1) U { S s; -}; // Error: \tcode{U} specifies an alignment that is less strict than +}; // error: \tcode{U} specifies an alignment that is less strict than // if the \tcode{alignas(1)} were omitted. \end{codeblock} \end{example} diff --git a/source/declarators.tex b/source/declarators.tex index 127d611565..65c407d4ec 100644 --- a/source/declarators.tex +++ b/source/declarators.tex @@ -1780,12 +1780,12 @@ \begin{example} \begin{codeblock} -void g(int = 0, ...); // OK, ellipsis is not a parameter so it can follow +void g(int = 0, ...); // OK: ellipsis is not a parameter so it can follow // a parameter with a default argument void f(int, int); void f(int, int = 7); void h() { - f(3); // OK, calls \tcode{f(3, 7)} + f(3); // OK: calls \tcode{f(3, 7)} void f(int = 1, int); // error: does not use default // from surrounding scope } @@ -1793,12 +1793,12 @@ void f(int, int); // has no defaults f(4); // error: wrong number of arguments void f(int, int = 5); // OK - f(4); // OK, calls \tcode{f(4, 5);} + f(4); // OK: calls \tcode{f(4, 5);} void f(int, int = 5); // error: cannot redefine, even to // same value } void n() { - f(6); // OK, calls \tcode{f(6, 7)} + f(6); // OK: calls \tcode{f(6, 7)} } \end{codeblock} \end{example} @@ -1929,7 +1929,7 @@ // used as default argument typedef int I; int g(float I, int b = I(2)); // error: parameter \tcode{I} found -int h(int a, int b = sizeof(a)); // OK, unevaluated operand +int h(int a, int b = sizeof(a)); // OK: unevaluated operand \end{codeblock} \end{example} A non-static member shall not appear in a default argument unless it appears as @@ -1949,7 +1949,7 @@ int a; int mem1(int i = a); // error: non-static member \tcode{a} // used as default argument - int mem2(int i = b); // OK; use \tcode{X::b} + int mem2(int i = b); // OK: use \tcode{X::b} static int b; }; \end{codeblock} @@ -1969,7 +1969,7 @@ void h() { int j = f(1); - int k = f(); // OK, means \tcode{f(0)} + int k = f(); // OK: means \tcode{f(0)} } int (*p1)(int) = &f; @@ -2007,7 +2007,7 @@ void m() { B* pb = new B; A* pa = pb; - pa->f(); // OK, calls \tcode{pa->B::f(7)} + pa->f(); // OK: calls \tcode{pa->B::f(7)} pb->f(); // error: wrong number of arguments for \tcode{B::f()} } \end{codeblock} @@ -2285,8 +2285,8 @@ void* operator new(std::size_t) = delete; void* operator new[](std::size_t) = delete; }; -sometype* p = new sometype; // error, deleted class \tcode{operator new} -sometype* q = new sometype[3]; // error, deleted class \tcode{operator new[]} +sometype* p = new sometype; // error: deleted class \tcode{operator new} +sometype* q = new sometype[3]; // error: deleted class \tcode{operator new[]} \end{codeblock} \end{example} @@ -2304,7 +2304,7 @@ ~moveonly() = default; }; moveonly* p; -moveonly q(*p); // error, deleted copy constructor +moveonly q(*p); // error: deleted copy constructor \end{codeblock} \end{example} @@ -3904,7 +3904,7 @@ enum byte : unsigned char { }; byte b { 42 }; // OK byte c = { 42 }; // error -byte d = byte{ 42 }; // OK; same value as \tcode{b} +byte d = byte{ 42 }; // OK: same value as \tcode{b} byte e { -1 }; // error struct A { byte b; }; @@ -4014,7 +4014,7 @@ struct A { std::initializer_list i4; - A() : i4{ 1, 2, 3 } {} // ill-formed, would create a dangling reference + A() : i4{ 1, 2, 3 } {} // ill-formed: would create a dangling reference }; \end{codeblock} @@ -4063,7 +4063,7 @@ int x = 999; // x is not a constant expression const int y = 999; const int z = 99; -char c1 = x; // OK, though it might narrow (in this case, it does narrow) +char c1 = x; // OK: though it might narrow (in this case, it does narrow) char c2{x}; // error: might narrow char c3{y}; // error: narrows (assuming \tcode{char} is 8 bits) char c4{z}; // OK: no narrowing needed diff --git a/source/derived.tex b/source/derived.tex index 8e3e2a6ec9..fdf2b39813 100644 --- a/source/derived.tex +++ b/source/derived.tex @@ -414,7 +414,7 @@ struct F: public D, public E { }; // S(x,F) = S(x,E) int main() { F f; - f.x = 0; // OK, lookup finds \tcode{E::x} + f.x = 0; // OK: lookup finds \tcode{E::x} } \end{codeblock} @@ -477,7 +477,7 @@ pd->v++; // OK: only one \tcode{v} (virtual) pd->s++; // OK: only one \tcode{s} (static) int i = pd->e; // OK: only one \tcode{e} (enumerator) - pd->a++; // error, ambiguous: two \tcode{a}{s} in \tcode{D} + pd->a++; // error: ambiguous: two \tcode{a}{s} in \tcode{D} } \end{codeblock} \end{example} @@ -544,7 +544,7 @@ void g() { D d; B* pb = &d; - A* pa = &d; // error, ambiguous: \tcode{C}'s \tcode{A} or \tcode{B}'s \tcode{A}? + A* pa = &d; // error: ambiguous: \tcode{C}'s \tcode{A} or \tcode{B}'s \tcode{A}? V* pv = &d; // OK: only one \tcode{V} subobject } \end{codeblock} diff --git a/source/exceptions.tex b/source/exceptions.tex index 437ab81ae4..5162933abf 100644 --- a/source/exceptions.tex +++ b/source/exceptions.tex @@ -1035,7 +1035,7 @@ an exception~(\ref{thread.thread.constr}), or \item% -for a parallel algorithm whose \tcode{ExecutionPolicy} specifies such +for parallel algorithms whose \tcode{ExecutionPolicy} specify such behavior~(\ref{execpol.seq}, \ref{execpol.par}, \ref{execpol.parunseq}), when execution of an element access function~(\ref{algorithms.parallel.defns}) of the parallel algorithm exits via an exception~(\ref{algorithms.parallel.exceptions}), or diff --git a/source/expressions.tex b/source/expressions.tex index ccb304e834..d49650861e 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -685,7 +685,7 @@ // cannot perform an lvalue-to-rvalue conversion on one of its subobjects (that represents its capture) // in a constant expression. auto two = monoid(2); -assert(two() == 2); // OK, not a constant expression. +assert(two() == 2); // OK: not a constant expression. static_assert(add(one)(one)() == two()); // ill-formed: \tcode{two()} is not a constant expression static_assert(add(one)(one)() == monoid(2)()); // OK \end{codeblock} @@ -2275,8 +2275,8 @@ struct B { }; struct D : private B { }; void f() { - static_cast((B*)0); // Error: B is a private base of D. - static_cast((int D::*)0); // Error: B is a private base of D. + static_cast((B*)0); // error: B is a private base of D. + static_cast((int D::*)0); // error: B is a private base of D. } \end{codeblock} \end{example} @@ -2573,7 +2573,7 @@ typedef int *A[3]; // array of 3 pointer to \tcode{int} typedef const int *const CA[3]; // array of 3 const pointer to \tcode{const int} -CA &&r = A{}; // OK, reference binds to temporary array object after qualification conversion to type \tcode{CA} +CA &&r = A{}; // OK: reference binds to temporary array object after qualification conversion to type \tcode{CA} A &&r1 = const_cast(CA{}); // error: temporary array decayed to pointer A &&r2 = const_cast(CA{}); // OK \end{codeblock} @@ -4982,8 +4982,8 @@ void g() { const int n = 0; [=] { - constexpr int i = n; // OK, \tcode{n} is not odr-used and not captured here - constexpr int j = *&n; // ill-formed, \tcode{\&n} would be an odr-use of \tcode{n} + constexpr int i = n; // OK: \tcode{n} is not odr-used and not captured here + constexpr int j = *&n; // ill-formed: \tcode{\&n} would be an odr-use of \tcode{n} }; } \end{codeblock} @@ -5210,7 +5210,7 @@ template struct X { }; constexpr A a = 42; X x; // OK: unique conversion to \tcode{int} -int ary[a]; // error: ambiguous conversion +int ary[a]; // error: ambiguous: conversion \end{codeblock} \end{example}% \indextext{expression|)} diff --git a/source/intro.tex b/source/intro.tex index 9765baeb5d..17671d395c 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -596,8 +596,8 @@ union U { X x; float f; }; void tong() { U u = {{ 1 }}; - u.f = 5.f; // OK, creates new subobject of \tcode{u} (\ref{class.union}) - X *p = new (&u.x) X {2}; // OK, creates new subobject of \tcode{u} + u.f = 5.f; // OK: creates new subobject of \tcode{u} (\ref{class.union}) + X *p = new (&u.x) X {2}; // OK: creates new subobject of \tcode{u} assert(p->n == 2); // OK assert(*std::launder(&u.x.n) == 2); // OK assert(u.x.n == 2); // undefined behavior, \tcode{u.x} does not name new subobject @@ -634,8 +634,8 @@ }; int f() { AlignedUnion au; - int *p = new (au.data) int; // OK, \tcode{au.data} provides storage - char *c = new (au.data) char(); // OK, ends lifetime of \tcode{*p} + int *p = new (au.data) int; // OK: \tcode{au.data} provides storage + char *c = new (au.data) char(); // OK: ends lifetime of \tcode{*p} char *d = new (au.data + 1) char(); return *c + *d; // OK } diff --git a/source/overloading.tex b/source/overloading.tex index 8b7fc57264..4ae6026e83 100644 --- a/source/overloading.tex +++ b/source/overloading.tex @@ -117,9 +117,9 @@ class Y { void h() &; void h() const &; // OK - void h() &&; // OK, all declarations have a ref-qualifier + void h() &&; // OK: all declarations have a ref-qualifier void i() &; - void i() const; // ill-formed, prior declaration of \tcode{i} + void i() const; // ill-formed: prior declaration of \tcode{i} // has a ref-qualifier }; \end{codeblock} @@ -297,7 +297,7 @@ void prog () { f (1, 2); // OK: call \tcode{f(int, int)} f (1); // OK: call \tcode{f(int, int)} - f (); // Error: \tcode{f(int, int)} or \tcode{f()}? + f (); // error: \tcode{f(int, int)} or \tcode{f()}? } \end{codeblock} \end{example} @@ -341,7 +341,7 @@ pd->f(1); // error: // \tcode{D::f(const char*)} hides \tcode{B::f(int)} pd->B::f(1); // OK - pd->f("Ben"); // OK, calls \tcode{D::f} + pd->f("Ben"); // OK: calls \tcode{D::f} } \end{codeblock} \end{example} @@ -1784,8 +1784,8 @@ using B::f; void use() { - f(3); // OK, default argument was not used for viability - f(); // Error: found default argument twice + f(3); // OK: default argument was not used for viability + f(); // error: found default argument twice } \end{codeblock} \end{example} @@ -2222,10 +2222,10 @@ A(std::initializer_list>); // \#2 A(std::initializer_list); // \#3 }; -A a{ 1.0,2.0 }; // OK, uses \#1 +A a{ 1.0,2.0 }; // OK: uses \#1 void g(A); -g({ "foo", "bar" }); // OK, uses \#3 +g({ "foo", "bar" }); // OK: uses \#3 typedef int IA[3]; void h(const IA&); @@ -2277,7 +2277,7 @@ g( {1.0, 1.0} ); // error: narrowing void f(B); -f( {'a', 'b'} ); // error: ambiguous \tcode{f(A)} or \tcode{f(B)} +f( {'a', 'b'} ); // error: ambiguous: \tcode{f(A)} or \tcode{f(B)} struct C { C(std::string); diff --git a/source/special.tex b/source/special.tex index 55dab0c8df..f66cd492e2 100644 --- a/source/special.tex +++ b/source/special.tex @@ -1885,7 +1885,7 @@ const int& v = 42; // OK }; A a1; // error: ill-formed binding of temporary to reference -A a2(1); // OK, unfortunately +A a2(1); // OK: unfortunately \end{codeblock} \end{example} @@ -2233,7 +2233,7 @@ B bobj; // definition of \tcode{bobj} extern X xobj; -int* p3 = &xobj.i; // OK, \tcode{X} is a trivial class +int* p3 = &xobj.i; // OK: \tcode{X} is a trivial class X xobj; \end{codeblock} @@ -2515,7 +2515,7 @@ X(const X&); X(X&); // OK X(X&&); - X(const X&&); // OK, but possibly not sensible + X(const X&&); // OK: but possibly not sensible }; \end{codeblock} \end{example} diff --git a/source/statements.tex b/source/statements.tex index 6c8abf4f1c..2e3e59ebc9 100644 --- a/source/statements.tex +++ b/source/statements.tex @@ -55,10 +55,10 @@ \begin{codeblock} if (int x = f()) { - int x; // ill-formed, redeclaration of \tcode{x} + int x; // ill-formed: redeclaration of \tcode{x} } else { - int x; // ill-formed, redeclaration of \tcode{x} + int x; // ill-formed: redeclaration of \tcode{x} } \end{codeblock} \end{example} @@ -900,7 +900,7 @@ X a = 1; // ... lx: - goto ly; // OK, jump implies destructor + goto ly; // OK: jump implies destructor // call for \tcode{a} followed by construction // again immediately following label \tcode{ly} } diff --git a/source/templates.tex b/source/templates.tex index 95df18269d..cc7616895e 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -638,7 +638,7 @@ X<(1>2)> x2; // OK template class Y @\tcode{\{ /* ... */ \};}@ -Y> x3; // OK, same as \tcode{Y > x3;} +Y> x3; // OK: same as \tcode{Y > x3;} Y>1>> x4; // syntax error Y>1)>> x5; // OK \end{codeblock} @@ -2544,12 +2544,12 @@ int main() { A a0; A a2; - a0.f(); // OK, uses definition of primary template's member - a2.g(); // OK, uses definition of + a0.f(); // OK: uses definition of primary template's member + a2.g(); // OK: uses definition of // partial specialization's member - a2.h(); // OK, uses definition of + a2.h(); // OK: uses definition of // explicit specialization's member - a2.f(); // ill-formed, no definition of \tcode{f} for \tcode{A} + a2.f(); // ill-formed: no definition of \tcode{f} for \tcode{A} // the primary template is not used here } \end{codeblock} @@ -2987,7 +2987,7 @@ \begin{codeblock} template using void_t = void; template void_t f(); -f(); // error, \tcode{int} does not have a nested type \tcode{foo} +f(); // error: \tcode{int} does not have a nested type \tcode{foo} \end{codeblock} \end{example} @@ -3052,10 +3052,10 @@ TA* a5; // declare pointer to \tcode{T}'s \tcode{A} typename T::A* a6; // declare pointer to \tcode{T}'s \tcode{A} T::A* a7; // \tcode{T::A} is not a type name: - // multiply \tcode{T::A} by \tcode{a7}; ill-formed, + // multiply \tcode{T::A} by \tcode{a7}; ill-formed: // no visible declaration of \tcode{a7} B* a8; // \tcode{B} is not a type name: - // multiply \tcode{B} by \tcode{a8}; ill-formed, + // multiply \tcode{B} by \tcode{a8}; ill-formed: // no visible declarations of \tcode{B} and \tcode{a8} } }; @@ -3185,7 +3185,7 @@ \begin{codeblock} template struct A { typedef int B; - B b; // OK, no typename required + B b; // OK: no typename required }; \end{codeblock} \end{example} @@ -3839,7 +3839,7 @@ }; template struct A::B::C : A { - M m; // OK, \tcode{A::M} + M m; // OK: \tcode{A::M} }; \end{codeblock} \end{example} @@ -5331,7 +5331,7 @@ template<> enum class A::S : int { sint }; // OK template enum A::E : T { eT }; template enum class A::S : T { sT }; -template<> enum A::E : char { echar }; // ill-formed, \tcode{A::E} was instantiated +template<> enum A::E : char { echar }; // ill-formed: \tcode{A::E} was instantiated // when \tcode{A} was instantiated template<> enum class A::S : char { schar }; // OK \end{codeblock} @@ -5771,7 +5771,7 @@ }; void g() { - f(1); // OK, means \tcode{f(Complex(1))} + f(1); // OK: means \tcode{f(Complex(1))} } \end{codeblock} \end{note} @@ -5998,8 +5998,8 @@ template void g(...) { } void h() { - f(0); // OK, substituting return type causes deduction to fail - g(0); // error, substituting parameter type instantiates \tcode{A} + f(0); // OK: substituting return type causes deduction to fail + g(0); // error: substituting parameter type instantiates \tcode{A} } \end{codeblock} \end{example} @@ -6204,13 +6204,13 @@ struct Aggr { int i; int j; }; template void k(Aggr const(&)[N]); k({1,2,3}); // error: deduction fails, no conversion from \tcode{int} to \tcode{Aggr} -k({{1},{2},{3}}); // OK, \tcode{N} deduced to \tcode{3} +k({{1},{2},{3}}); // OK: \tcode{N} deduced to \tcode{3} template void m(int const(&)[M][N]); m({{1,2},{3,4}}); // \tcode{M} and \tcode{N} both deduced to \tcode{2} template void n(T const(&)[N], T); -n({{1},{2},{3}},Aggr()); // OK, \tcode{T} is \tcode{Aggr}, \tcode{N} is \tcode{3} +n({{1},{2},{3}},Aggr()); // OK: \tcode{T} is \tcode{Aggr}, \tcode{N} is \tcode{3} \end{codeblock} \end{example} For a function parameter pack that occurs at the end @@ -6236,7 +6236,7 @@ f(x, y, z); // \tcode{Types} is deduced to \tcode{int}, \tcode{float}, \tcode{const int} g(x, y, z); // \tcode{T1} is deduced to \tcode{int}; \tcode{Types} is deduced to \tcode{float}, \tcode{int} g1(x, y, z); // error: \tcode{Types} is not deduced - g1(x, y, z); // OK, no deduction occurs + g1(x, y, z); // OK: no deduction occurs } \end{codeblock} @@ -6474,7 +6474,7 @@ template void f(int, T); // \#2 struct A {} a; int main() { - f(1, a); // OK, deduction fails for \#1 because there is no conversion from int to void* + f(1, a); // OK: deduction fails for \#1 because there is no conversion from int to void* } \end{codeblock} \end{example} @@ -7286,7 +7286,7 @@ }; using R = long; -using R = C>::Q; // OK; \tcode{T} was deduced to \tcode{long} from the +using R = C>::Q; // OK: \tcode{T} was deduced to \tcode{long} from the // template argument value in the type \tcode{A<2>} \end{codeblock} \end{example} @@ -7299,7 +7299,7 @@ }; using V = decltype(sizeof 0); -using V = S::Q; // OK; \tcode{T} was deduced to \tcode{std::size_t} from the type \tcode{int[42]} +using V = S::Q; // OK: \tcode{T} was deduced to \tcode{std::size_t} from the type \tcode{int[42]} \end{codeblock} \end{example} @@ -7490,7 +7490,7 @@ Y<> y1; // use primary template; \tcode{Types} is empty Y y2; // uses partial specialization; \tcode{T} is \tcode{int\&}, \tcode{Types} contains \tcode{float}, \tcode{double} Y y3; // uses primary template; \tcode{Types} contains \tcode{int}, \tcode{float}, \tcode{double} -int fv = f(g); // OK; \tcode{Types} contains \tcode{int}, \tcode{float} +int fv = f(g); // OK: \tcode{Types} contains \tcode{int}, \tcode{float} \end{codeblock} \end{example} diff --git a/source/utilities.tex b/source/utilities.tex index 93178f759e..38ea4d441b 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -5877,7 +5877,7 @@ const any y(cat); // \tcode{const y} holds \tcode{string} assert(any_cast(y) == cat); -any_cast(y); // error; cannot +any_cast(y); // error: cannot // \tcode{any_cast} away const \end{codeblock} \end{example} @@ -9401,7 +9401,7 @@ template bool owner_before(const weak_ptr& b) const; }; - // \ref{util.smartptr.shared.create}, shared_ptr creation + // \ref{util.smartptr.shared.create}, shared_ptr creation: template shared_ptr make_shared(Args&&... args); template shared_ptr allocate_shared(const A& a, Args&&... args); @@ -19076,7 +19076,7 @@ \pnum During the execution of a parallel algorithm with -the \tcode{execution::sequenced_policy} policy, +the \tcode{execution::sequenced_policy_policy_policy} policy, if the invocation of an element access function exits via an uncaught exception, \tcode{terminate()} shall be called. \end{itemdescr} @@ -19117,7 +19117,11 @@ \pnum During the execution of a parallel algorithm with +<<<<<<< 1f1a2392349f126adec4ea6f3b3fd4cf7632e311 the \tcode{execution::parallel_unsequenced_policy} policy, +======= +the \tcode{execution::parallel_policy_policy} policy, +>>>>>>> NB US-15, US-16, US-167, US-168, US-169, US-170, CA-17 P0502R0 Throwing out of a parallel algorithm terminates—but how? if the invocation of an element access function exits via an uncaught exception, \tcode{terminate()} shall be called. \end{itemdescr}