Skip to content

[std] Replace 'OK:' in code comments with 'OK,' #5080

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 42 additions & 42 deletions source/basic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@
enum E : int { a };
void f(int); // \#1
void f(Int) {} // defines \#1
void f(E) {} // OK: another overload
void f(E) {} // OK, another overload

struct X {
static void f();
Expand All @@ -960,7 +960,7 @@
void g() &; // error: redeclaration

void h(this X&, int);
void h(int) &&; // OK: another overload
void h(int) &&; // OK, another overload
void j(this const X&);
void j() const&; // error: redeclaration
void k();
Expand Down Expand Up @@ -993,9 +993,9 @@
enum { f }; // error: different entity for \tcode{::f}
namespace A {}
namespace B = A;
namespace B = A; // OK: no effect
namespace B = B; // OK: no effect
namespace A = B; // OK: no effect
namespace B = A; // OK, no effect
namespace B = B; // OK, no effect
namespace A = B; // OK, no effect
namespace B {} // error: different entity for \tcode{B}
\end{codeblock}
\end{example}
Expand Down Expand Up @@ -1452,7 +1452,7 @@

\begin{codeblocktu}{Translation unit \#3}
import R;
int main() { return sq(9); } // OK: \tcode{sq} from module \tcode{Q}
int main() { return sq(9); } // OK, \tcode{sq} from module \tcode{Q}
\end{codeblocktu}
\end{example}
\end{note}
Expand Down Expand Up @@ -1616,9 +1616,9 @@
struct D : B, C { };

void f(D* pd) {
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->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}
}
\end{codeblock}
Expand Down Expand Up @@ -1658,8 +1658,8 @@
right-hand instance of \tcode{W} are not hidden at all.
\begin{codeblock}
void D::glorp() {
x++; // OK: \tcode{B::x} hides \tcode{V::x}
f(); // OK: \tcode{B::f()} hides \tcode{V::f()}
x++; // OK, \tcode{B::x} hides \tcode{V::x}
f(); // OK, \tcode{B::f()} hides \tcode{V::f()}
y++; // error: \tcode{B::y} and \tcode{C}'s \tcode{W::y}
g(); // error: \tcode{B::g()} and \tcode{C}'s \tcode{W::g()}
}
Expand All @@ -1685,7 +1685,7 @@
D d;
B* pb = &d;
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
V* pv = &d; // OK, only one \tcode{V} subobject
}
\end{codeblock}
\end{example}
Expand Down Expand Up @@ -1886,7 +1886,7 @@

void g() {
N::S s;
f(s); // OK: calls \tcode{N::f}
f(s); // OK, calls \tcode{N::f}
(f)(s); // error: \tcode{N::f} not considered; parentheses prevent argument-dependent lookup
}
\end{codeblock}
Expand All @@ -1913,8 +1913,8 @@
template <class T> int h(T);
}

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

Expand Down Expand Up @@ -2086,9 +2086,9 @@
NS::T parm;
void g(NS::T, float);
int main() {
f(parm); // OK: calls \tcode{NS::f}
f(parm); // OK, calls \tcode{NS::f}
extern void g(NS::T, float);
g(parm, 1); // OK: calls \tcode{g(NS::T, float)}
g(parm, 1); // OK, calls \tcode{g(NS::T, float)}
}
\end{codeblock}
\end{example}
Expand Down Expand Up @@ -2215,8 +2215,8 @@
template<class T>
void g(T *p) { // as instantiated for \tcode{g<A>}:
p->X<0>::f(); // error: \tcode{A::X} not found in \tcode{((p->X) < 0) > ::f()}
p->template X<0>::f(); // OK: \tcode{::X} found in definition context
p->B::f(); // OK: non-type \tcode{A::B} ignored
p->template X<0>::f(); // OK, \tcode{::X} found in definition context
p->B::f(); // OK, non-type \tcode{A::B} ignored
p->template C<0>::f(); // error: \tcode{A::C} is not a template
p->template D<0>::f(); // error: \tcode{A::D<0>} is not a class type
p->T::f(); // error: \tcode{A::T} is not a class type
Expand Down Expand Up @@ -2405,7 +2405,7 @@

void f()
{
BC::a++; // OK: \tcode{S} is $\{ \tcode{A::a}, \tcode{A::a} \}$
BC::a++; // OK, \tcode{S} is $\{ \tcode{A::a}, \tcode{A::a} \}$
}

namespace D {
Expand All @@ -2419,7 +2419,7 @@

void g()
{
BD::a++; // OK: \tcode{S} is $\{ \tcode{A::a}, \tcode{A::a} \}$
BD::a++; // OK, \tcode{S} is $\{ \tcode{A::a}, \tcode{A::a} \}$
}
\end{codeblock}
\end{example}
Expand All @@ -2445,10 +2445,10 @@

void f()
{
A::a++; // OK: \tcode{a} declared directly in \tcode{A}, \tcode{S} is $\{ \tcode{A::a} \}$
B::a++; // OK: both \tcode{A} and \tcode{B} searched (once), \tcode{S} is $\{ \tcode{A::a} \}$
A::b++; // OK: both \tcode{A} and \tcode{B} searched (once), \tcode{S} is $\{ \tcode{B::b} \}$
B::b++; // OK: \tcode{b} declared directly in \tcode{B}, \tcode{S} is $\{ \tcode{B::b} \}$
A::a++; // OK, \tcode{a} declared directly in \tcode{A}, \tcode{S} is $\{ \tcode{A::a} \}$
B::a++; // OK, both \tcode{A} and \tcode{B} searched (once), \tcode{S} is $\{ \tcode{A::a} \}$
A::b++; // OK, both \tcode{A} and \tcode{B} searched (once), \tcode{S} is $\{ \tcode{B::b} \}$
B::b++; // OK, \tcode{b} declared directly in \tcode{B}, \tcode{S} is $\{ \tcode{B::b} \}$
}
\end{codeblock}
\end{example}
Expand Down Expand Up @@ -2509,31 +2509,31 @@
\begin{example}
\begin{codeblock}
struct Node {
struct Node* Next; // OK: Refers to injected-class-name \tcode{Node}
struct Data* Data; // OK: Declares type \tcode{Data} at global scope and member \tcode{Data}
struct Node* Next; // OK, refers to injected-class-name \tcode{Node}
struct Data* Data; // OK, declares type \tcode{Data} at global scope and member \tcode{Data}
};

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

struct Base {
struct Data; // OK: Declares nested \tcode{Data}
struct ::Data* thatData; // OK: Refers to \tcode{::Data}
struct Base::Data* thisData; // OK: Refers to nested \tcode{Data}
friend class ::Data; // OK: global \tcode{Data} is a friend
friend class Data; // OK: nested \tcode{Data} is a friend
struct Data; // OK, declares nested \tcode{Data}
struct ::Data* thatData; // OK, refers to \tcode{::Data}
struct Base::Data* thisData; // OK, refers to nested \tcode{Data}
friend class ::Data; // OK, global \tcode{Data} is a friend
friend class Data; // OK, nested \tcode{Data} is a friend
struct Data { @\commentellip@ }; // Defines nested \tcode{Data}
};

struct Data; // OK: Redeclares \tcode{Data} at global scope
struct Data; // OK, redeclares \tcode{Data} at global scope
struct ::Data; // error: cannot introduce a qualified type\iref{dcl.type.elab}
struct Base::Data; // error: cannot introduce a qualified type\iref{dcl.type.elab}
struct Base::Datum; // error: \tcode{Datum} undefined
struct Base::Data* pBase; // OK: refers to nested \tcode{Data}
struct Base::Data* pBase; // OK, refers to nested \tcode{Data}
\end{codeblock}
\end{example}
\indextext{lookup!elaborated type specifier|)}%
Expand Down Expand Up @@ -2739,7 +2739,7 @@
module;
#include "decls.h"
export module M;
export using ::f; // OK: does not declare an entity, exports \#1
export using ::f; // OK, does not declare an entity, exports \#1
int g(); // error: matches \#2, but attached to \tcode{M}
export int h(); // \#3
export int k(); // \#4
Expand Down Expand Up @@ -2799,7 +2799,7 @@
\begin{codeblock}
int f(int x, int x); // error: different entities for \tcode{x}
void g(); // \#1
void g(int); // OK: different entity from \#1
void g(int); // OK, different entity from \#1
int g(); // error: same entity as \#1 with different type
void h(); // \#2
namespace h {} // error: same entity as \#2, but not a function
Expand Down Expand Up @@ -3458,8 +3458,8 @@
void* p = std::malloc(sizeof(D1) + sizeof(D2));
B* pb = new (p) D1;
pb->mutate();
*pb; // OK: \tcode{pb} points to valid memory
void* q = pb; // OK: \tcode{pb} points to valid memory
*pb; // OK, \tcode{pb} points to valid memory
void* q = pb; // OK, \tcode{pb} points to valid memory
pb->f(); // undefined behavior: lifetime of \tcode{*pb} has ended
}
\end{codeblock}
Expand Down Expand Up @@ -4651,7 +4651,7 @@
void foo() {
xp++; // error: \tcode{X} is incomplete
arrp++; // error: incomplete type
arrpp++; // OK: sizeof \tcode{UNKA*} is known
arrpp++; // OK, sizeof \tcode{UNKA*} is known
}

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