File tree Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 840840 class Y;
841841 extern void b();
842842 class A {
843- friend class X; // OK: but \tcode {X} is a local class, not \tcode {::X}
843+ friend class X; // OK, but \tcode {X} is a local class, not \tcode {::X}
844844 friend class Y; // OK
845845 friend class Z; // OK: introduces local class \tcode {Z}
846846 friend void a(); // error: \tcode {::a} is not considered
847847 friend void b(); // OK
848848 friend void c(); // error
849849 };
850- X* px; // OK: but \tcode {::X} is found
850+ X* px; // OK, but \tcode {::X} is found
851851 Z* pz; // error: no \tcode {Z} is found
852852}
853853\end {codeblock }
Original file line number Diff line number Diff line change 940940
941941typedef int I;
942942class D {
943- typedef I I; // error: even though no reordering involved
943+ typedef I I; // error, even though no reordering involved
944944};
945945\end {codeblock }
946946\end {example }
Original file line number Diff line number Diff line change 155155
156156\begin {codeblock }
157157enum { }; // ill-formed
158- typedef class { }; // ill-formed
158+ typedef class { }; // ill-formed
159159\end {codeblock }
160160\end {example }
161161
905905\begin {codeblock }
906906constexpr int f(bool b)
907907 { return b ? throw 0 : 0; } // OK
908- constexpr int f() { return f(true); } // ill-formed: no diagnostic required
908+ constexpr int f() { return f(true); } // ill-formed, no diagnostic required
909909
910910struct B {
911911 constexpr B(int x) : i(0) { } // \tcode {x} is unused
915915int global;
916916
917917struct D : B {
918- constexpr D() : B(global) { } // ill-formed: no diagnostic required
918+ constexpr D() : B(global) { } // ill-formed, no diagnostic required
919919 // lvalue-to-rvalue conversion on non-constant \tcode {global}
920920};
921921\end {codeblock }
16801680body.
16811681\begin {example }
16821682\begin {codeblock }
1683- auto f() { } // OK: return type is \tcode {void}
1683+ auto f() { } // OK, return type is \tcode {void}
16841684auto* g() { } // error: cannot deduce \tcode {auto*} from \tcode {void()}
16851685\end {codeblock }
16861686\end {example }
17361736decltype(auto) f(); // error: \tcode {auto} and \tcode {decltype(auto)} don't match
17371737
17381738template <typename T> auto g(T t) { return t; } // \# 1
1739- template auto g(int); // OK: return type is \tcode {int}
1739+ template auto g(int); // OK, return type is \tcode {int}
17401740template char g(char); // error: no matching template
17411741template<> auto g(double); // OK: forward declaration with unknown return type
17421742
Original file line number Diff line number Diff line change 620620or allow it to be changed through a cv-unqualified pointer later, for example:
621621
622622\begin {codeblock }
623- *ppc = &ci; // OK: but would make \tcode {p} point to \tcode {ci} ...
623+ *ppc = &ci; // OK, but would make \tcode {p} point to \tcode {ci} ...
624624 // ... because of previous error
625625*p = 5; // clobber \tcode {ci}
626626\end {codeblock }
22712271
22722272\begin {codeblock }
22732273struct onlydouble {
2274- onlydouble() = delete; // OK: but redundant
2274+ onlydouble() = delete; // OK, but redundant
22752275 onlydouble(std::intmax_t) = delete;
22762276 onlydouble(double);
22772277};
27112711\begin {codeblock }
27122712 int f(bool b) {
27132713 unsigned char c;
2714- unsigned char d = c; // OK: \tcode {d} has an indeterminate value
2714+ unsigned char d = c; // OK, \tcode {d} has an indeterminate value
27152715 int e = d; // undefined behavior
27162716 return b ? d : 0; // undefined behavior if \tcode {b} is \tcode {true}
27172717 }
You can’t perform that action at this time.
0 commit comments