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 840
840
class Y;
841
841
extern void b();
842
842
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}
844
844
friend class Y; // OK
845
845
friend class Z; // OK: introduces local class \tcode {Z}
846
846
friend void a(); // error: \tcode {::a} is not considered
847
847
friend void b(); // OK
848
848
friend void c(); // error
849
849
};
850
- X* px; // OK: but \tcode {::X} is found
850
+ X* px; // OK, but \tcode {::X} is found
851
851
Z* pz; // error: no \tcode {Z} is found
852
852
}
853
853
\end {codeblock }
Original file line number Diff line number Diff line change 929
929
930
930
typedef int I;
931
931
class D {
932
- typedef I I; // error: even though no reordering involved
932
+ typedef I I; // error, even though no reordering involved
933
933
};
934
934
\end {codeblock }
935
935
\end {example }
Original file line number Diff line number Diff line change 154
154
155
155
\begin {codeblock }
156
156
enum { }; // ill-formed
157
- typedef class { }; // ill-formed
157
+ typedef class { }; // ill-formed
158
158
\end {codeblock }
159
159
\end {example }
160
160
906
906
\begin {codeblock }
907
907
constexpr int f(bool b)
908
908
{ return b ? throw 0 : 0; } // OK
909
- constexpr int f() { return f(true); } // ill-formed: no diagnostic required
909
+ constexpr int f() { return f(true); } // ill-formed, no diagnostic required
910
910
911
911
struct B {
912
912
constexpr B(int x) : i(0) { } // \tcode {x} is unused
916
916
int global;
917
917
918
918
struct D : B {
919
- constexpr D() : B(global) { } // ill-formed: no diagnostic required
919
+ constexpr D() : B(global) { } // ill-formed, no diagnostic required
920
920
// lvalue-to-rvalue conversion on non-constant \tcode {global}
921
921
};
922
922
\end {codeblock }
1677
1677
body.
1678
1678
\begin {example }
1679
1679
\begin {codeblock }
1680
- auto f() { } // OK: return type is \tcode {void}
1680
+ auto f() { } // OK, return type is \tcode {void}
1681
1681
auto* g() { } // error: cannot deduce \tcode {auto*} from \tcode {void()}
1682
1682
\end {codeblock }
1683
1683
\end {example }
1733
1733
decltype(auto) f(); // error: \tcode {auto} and \tcode {decltype(auto)} don't match
1734
1734
1735
1735
template <typename T> auto g(T t) { return t; } // \# 1
1736
- template auto g(int); // OK: return type is \tcode {int}
1736
+ template auto g(int); // OK, return type is \tcode {int}
1737
1737
template char g(char); // error: no matching template
1738
1738
template<> auto g(double); // OK: forward declaration with unknown return type
1739
1739
Original file line number Diff line number Diff line change 620
620
or allow it to be changed through a cv-unqualified pointer later, for example:
621
621
622
622
\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} ...
624
624
// ... because of previous error
625
625
*p = 5; // clobber \tcode {ci}
626
626
\end {codeblock }
2268
2268
2269
2269
\begin {codeblock }
2270
2270
struct onlydouble {
2271
- onlydouble() = delete; // OK: but redundant
2271
+ onlydouble() = delete; // OK, but redundant
2272
2272
onlydouble(std::intmax_t) = delete;
2273
2273
onlydouble(double);
2274
2274
};
2734
2734
\begin {codeblock }
2735
2735
int f(bool b) {
2736
2736
unsigned char c;
2737
- unsigned char d = c; // OK: \tcode {d} has an indeterminate value
2737
+ unsigned char d = c; // OK, \tcode {d} has an indeterminate value
2738
2738
int e = d; // undefined behavior
2739
2739
return b ? d : 0; // undefined behavior if \tcode {b} is \tcode {true}
2740
2740
}
You can’t perform that action at this time.
0 commit comments