Skip to content

Commit d2699e5

Browse files
jensmaurertkoeppe
authored andcommitted
[std] Replace 'OK:' in code comments with 'OK,'
In contrast to errors, which use a colon, an OK comment is not followed by any unique reason why the code is well-formed, but by a subjective highlighting of a fact.
1 parent c63e5e8 commit d2699e5

File tree

9 files changed

+246
-246
lines changed

9 files changed

+246
-246
lines changed

source/basic.tex

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@
950950
enum E : int { a };
951951
void f(int); // \#1
952952
void f(Int) {} // defines \#1
953-
void f(E) {} // OK: another overload
953+
void f(E) {} // OK, another overload
954954

955955
struct X {
956956
static void f();
@@ -960,7 +960,7 @@
960960
void g() &; // error: redeclaration
961961

962962
void h(this X&, int);
963-
void h(int) &&; // OK: another overload
963+
void h(int) &&; // OK, another overload
964964
void j(this const X&);
965965
void j() const&; // error: redeclaration
966966
void k();
@@ -993,9 +993,9 @@
993993
enum { f }; // error: different entity for \tcode{::f}
994994
namespace A {}
995995
namespace B = A;
996-
namespace B = A; // OK: no effect
997-
namespace B = B; // OK: no effect
998-
namespace A = B; // OK: no effect
996+
namespace B = A; // OK, no effect
997+
namespace B = B; // OK, no effect
998+
namespace A = B; // OK, no effect
999999
namespace B {} // error: different entity for \tcode{B}
10001000
\end{codeblock}
10011001
\end{example}
@@ -1452,7 +1452,7 @@
14521452

14531453
\begin{codeblocktu}{Translation unit \#3}
14541454
import R;
1455-
int main() { return sq(9); } // OK: \tcode{sq} from module \tcode{Q}
1455+
int main() { return sq(9); } // OK, \tcode{sq} from module \tcode{Q}
14561456
\end{codeblocktu}
14571457
\end{example}
14581458
\end{note}
@@ -1616,9 +1616,9 @@
16161616
struct D : B, C { };
16171617

16181618
void f(D* pd) {
1619-
pd->v++; // OK: only one \tcode{v} (virtual)
1620-
pd->s++; // OK: only one \tcode{s} (static)
1621-
int i = pd->e; // OK: only one \tcode{e} (enumerator)
1619+
pd->v++; // OK, only one \tcode{v} (virtual)
1620+
pd->s++; // OK, only one \tcode{s} (static)
1621+
int i = pd->e; // OK, only one \tcode{e} (enumerator)
16221622
pd->a++; // error: ambiguous: two \tcode{a}{s} in \tcode{D}
16231623
}
16241624
\end{codeblock}
@@ -1658,8 +1658,8 @@
16581658
right-hand instance of \tcode{W} are not hidden at all.
16591659
\begin{codeblock}
16601660
void D::glorp() {
1661-
x++; // OK: \tcode{B::x} hides \tcode{V::x}
1662-
f(); // OK: \tcode{B::f()} hides \tcode{V::f()}
1661+
x++; // OK, \tcode{B::x} hides \tcode{V::x}
1662+
f(); // OK, \tcode{B::f()} hides \tcode{V::f()}
16631663
y++; // error: \tcode{B::y} and \tcode{C}'s \tcode{W::y}
16641664
g(); // error: \tcode{B::g()} and \tcode{C}'s \tcode{W::g()}
16651665
}
@@ -1685,7 +1685,7 @@
16851685
D d;
16861686
B* pb = &d;
16871687
A* pa = &d; // error: ambiguous: \tcode{C}'s \tcode{A} or \tcode{B}'s \tcode{A}?
1688-
V* pv = &d; // OK: only one \tcode{V} subobject
1688+
V* pv = &d; // OK, only one \tcode{V} subobject
16891689
}
16901690
\end{codeblock}
16911691
\end{example}
@@ -1886,7 +1886,7 @@
18861886

18871887
void g() {
18881888
N::S s;
1889-
f(s); // OK: calls \tcode{N::f}
1889+
f(s); // OK, calls \tcode{N::f}
18901890
(f)(s); // error: \tcode{N::f} not considered; parentheses prevent argument-dependent lookup
18911891
}
18921892
\end{codeblock}
@@ -1913,8 +1913,8 @@
19131913
template <class T> int h(T);
19141914
}
19151915

1916-
int x = f<N::A>(N::A()); // OK: lookup of \tcode{f} finds nothing, \tcode{f} treated as template name
1917-
int y = g<N::A>(N::A()); // OK: lookup of \tcode{g} finds a function, \tcode{g} treated as template name
1916+
int x = f<N::A>(N::A()); // OK, lookup of \tcode{f} finds nothing, \tcode{f} treated as template name
1917+
int y = g<N::A>(N::A()); // OK, lookup of \tcode{g} finds a function, \tcode{g} treated as template name
19181918
int z = h<N::A>(N::A()); // error: \tcode{h<} does not begin a \grammarterm{template-id}
19191919
\end{codeblock}
19201920

@@ -2086,9 +2086,9 @@
20862086
NS::T parm;
20872087
void g(NS::T, float);
20882088
int main() {
2089-
f(parm); // OK: calls \tcode{NS::f}
2089+
f(parm); // OK, calls \tcode{NS::f}
20902090
extern void g(NS::T, float);
2091-
g(parm, 1); // OK: calls \tcode{g(NS::T, float)}
2091+
g(parm, 1); // OK, calls \tcode{g(NS::T, float)}
20922092
}
20932093
\end{codeblock}
20942094
\end{example}
@@ -2215,8 +2215,8 @@
22152215
template<class T>
22162216
void g(T *p) { // as instantiated for \tcode{g<A>}:
22172217
p->X<0>::f(); // error: \tcode{A::X} not found in \tcode{((p->X) < 0) > ::f()}
2218-
p->template X<0>::f(); // OK: \tcode{::X} found in definition context
2219-
p->B::f(); // OK: non-type \tcode{A::B} ignored
2218+
p->template X<0>::f(); // OK, \tcode{::X} found in definition context
2219+
p->B::f(); // OK, non-type \tcode{A::B} ignored
22202220
p->template C<0>::f(); // error: \tcode{A::C} is not a template
22212221
p->template D<0>::f(); // error: \tcode{A::D<0>} is not a class type
22222222
p->T::f(); // error: \tcode{A::T} is not a class type
@@ -2405,7 +2405,7 @@
24052405

24062406
void f()
24072407
{
2408-
BC::a++; // OK: \tcode{S} is $\{ \tcode{A::a}, \tcode{A::a} \}$
2408+
BC::a++; // OK, \tcode{S} is $\{ \tcode{A::a}, \tcode{A::a} \}$
24092409
}
24102410

24112411
namespace D {
@@ -2419,7 +2419,7 @@
24192419

24202420
void g()
24212421
{
2422-
BD::a++; // OK: \tcode{S} is $\{ \tcode{A::a}, \tcode{A::a} \}$
2422+
BD::a++; // OK, \tcode{S} is $\{ \tcode{A::a}, \tcode{A::a} \}$
24232423
}
24242424
\end{codeblock}
24252425
\end{example}
@@ -2445,10 +2445,10 @@
24452445

24462446
void f()
24472447
{
2448-
A::a++; // OK: \tcode{a} declared directly in \tcode{A}, \tcode{S} is $\{ \tcode{A::a} \}$
2449-
B::a++; // OK: both \tcode{A} and \tcode{B} searched (once), \tcode{S} is $\{ \tcode{A::a} \}$
2450-
A::b++; // OK: both \tcode{A} and \tcode{B} searched (once), \tcode{S} is $\{ \tcode{B::b} \}$
2451-
B::b++; // OK: \tcode{b} declared directly in \tcode{B}, \tcode{S} is $\{ \tcode{B::b} \}$
2448+
A::a++; // OK, \tcode{a} declared directly in \tcode{A}, \tcode{S} is $\{ \tcode{A::a} \}$
2449+
B::a++; // OK, both \tcode{A} and \tcode{B} searched (once), \tcode{S} is $\{ \tcode{A::a} \}$
2450+
A::b++; // OK, both \tcode{A} and \tcode{B} searched (once), \tcode{S} is $\{ \tcode{B::b} \}$
2451+
B::b++; // OK, \tcode{b} declared directly in \tcode{B}, \tcode{S} is $\{ \tcode{B::b} \}$
24522452
}
24532453
\end{codeblock}
24542454
\end{example}
@@ -2509,31 +2509,31 @@
25092509
\begin{example}
25102510
\begin{codeblock}
25112511
struct Node {
2512-
struct Node* Next; // OK: Refers to injected-class-name \tcode{Node}
2513-
struct Data* Data; // OK: Declares type \tcode{Data} at global scope and member \tcode{Data}
2512+
struct Node* Next; // OK, refers to injected-class-name \tcode{Node}
2513+
struct Data* Data; // OK, declares type \tcode{Data} at global scope and member \tcode{Data}
25142514
};
25152515

25162516
struct Data {
2517-
struct Node* Node; // OK: Refers to \tcode{Node} at global scope
2517+
struct Node* Node; // OK, refers to \tcode{Node} at global scope
25182518
friend struct ::Glob; // error: \tcode{Glob} is not declared, cannot introduce a qualified type\iref{dcl.type.elab}
2519-
friend struct Glob; // OK: Refers to (as yet) undeclared \tcode{Glob} at global scope.
2519+
friend struct Glob; // OK, refers to (as yet) undeclared \tcode{Glob} at global scope.
25202520
@\commentellip@
25212521
};
25222522

25232523
struct Base {
2524-
struct Data; // OK: Declares nested \tcode{Data}
2525-
struct ::Data* thatData; // OK: Refers to \tcode{::Data}
2526-
struct Base::Data* thisData; // OK: Refers to nested \tcode{Data}
2527-
friend class ::Data; // OK: global \tcode{Data} is a friend
2528-
friend class Data; // OK: nested \tcode{Data} is a friend
2524+
struct Data; // OK, declares nested \tcode{Data}
2525+
struct ::Data* thatData; // OK, refers to \tcode{::Data}
2526+
struct Base::Data* thisData; // OK, refers to nested \tcode{Data}
2527+
friend class ::Data; // OK, global \tcode{Data} is a friend
2528+
friend class Data; // OK, nested \tcode{Data} is a friend
25292529
struct Data { @\commentellip@ }; // Defines nested \tcode{Data}
25302530
};
25312531

2532-
struct Data; // OK: Redeclares \tcode{Data} at global scope
2532+
struct Data; // OK, redeclares \tcode{Data} at global scope
25332533
struct ::Data; // error: cannot introduce a qualified type\iref{dcl.type.elab}
25342534
struct Base::Data; // error: cannot introduce a qualified type\iref{dcl.type.elab}
25352535
struct Base::Datum; // error: \tcode{Datum} undefined
2536-
struct Base::Data* pBase; // OK: refers to nested \tcode{Data}
2536+
struct Base::Data* pBase; // OK, refers to nested \tcode{Data}
25372537
\end{codeblock}
25382538
\end{example}
25392539
\indextext{lookup!elaborated type specifier|)}%
@@ -2739,7 +2739,7 @@
27392739
module;
27402740
#include "decls.h"
27412741
export module M;
2742-
export using ::f; // OK: does not declare an entity, exports \#1
2742+
export using ::f; // OK, does not declare an entity, exports \#1
27432743
int g(); // error: matches \#2, but attached to \tcode{M}
27442744
export int h(); // \#3
27452745
export int k(); // \#4
@@ -2799,7 +2799,7 @@
27992799
\begin{codeblock}
28002800
int f(int x, int x); // error: different entities for \tcode{x}
28012801
void g(); // \#1
2802-
void g(int); // OK: different entity from \#1
2802+
void g(int); // OK, different entity from \#1
28032803
int g(); // error: same entity as \#1 with different type
28042804
void h(); // \#2
28052805
namespace h {} // error: same entity as \#2, but not a function
@@ -3458,8 +3458,8 @@
34583458
void* p = std::malloc(sizeof(D1) + sizeof(D2));
34593459
B* pb = new (p) D1;
34603460
pb->mutate();
3461-
*pb; // OK: \tcode{pb} points to valid memory
3462-
void* q = pb; // OK: \tcode{pb} points to valid memory
3461+
*pb; // OK, \tcode{pb} points to valid memory
3462+
void* q = pb; // OK, \tcode{pb} points to valid memory
34633463
pb->f(); // undefined behavior: lifetime of \tcode{*pb} has ended
34643464
}
34653465
\end{codeblock}
@@ -4651,7 +4651,7 @@
46514651
void foo() {
46524652
xp++; // error: \tcode{X} is incomplete
46534653
arrp++; // error: incomplete type
4654-
arrpp++; // OK: sizeof \tcode{UNKA*} is known
4654+
arrpp++; // OK, sizeof \tcode{UNKA*} is known
46554655
}
46564656

46574657
struct X { int i; }; // now \tcode{X} is a complete type
@@ -4661,7 +4661,7 @@
46614661
void bar() {
46624662
xp = &x; // OK; type is ``pointer to \tcode{X}''
46634663
arrp = &arr; // OK; qualification conversion\iref{conv.qual}
4664-
xp++; // OK: \tcode{X} is complete
4664+
xp++; // OK, \tcode{X} is complete
46654665
arrp++; // error: \tcode{UNKA} can't be completed
46664666
}
46674667
\end{codeblock}

0 commit comments

Comments
 (0)