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 940
940
941
941
typedef int I;
942
942
class D {
943
- typedef I I; // error: even though no reordering involved
943
+ typedef I I; // error, even though no reordering involved
944
944
};
945
945
\end {codeblock }
946
946
\end {example }
Original file line number Diff line number Diff line change 155
155
156
156
\begin {codeblock }
157
157
enum { }; // ill-formed
158
- typedef class { }; // ill-formed
158
+ typedef class { }; // ill-formed
159
159
\end {codeblock }
160
160
\end {example }
161
161
905
905
\begin {codeblock }
906
906
constexpr int f(bool b)
907
907
{ 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
909
909
910
910
struct B {
911
911
constexpr B(int x) : i(0) { } // \tcode {x} is unused
915
915
int global;
916
916
917
917
struct D : B {
918
- constexpr D() : B(global) { } // ill-formed: no diagnostic required
918
+ constexpr D() : B(global) { } // ill-formed, no diagnostic required
919
919
// lvalue-to-rvalue conversion on non-constant \tcode {global}
920
920
};
921
921
\end {codeblock }
1680
1680
body.
1681
1681
\begin {example }
1682
1682
\begin {codeblock }
1683
- auto f() { } // OK: return type is \tcode {void}
1683
+ auto f() { } // OK, return type is \tcode {void}
1684
1684
auto* g() { } // error: cannot deduce \tcode {auto*} from \tcode {void()}
1685
1685
\end {codeblock }
1686
1686
\end {example }
1736
1736
decltype(auto) f(); // error: \tcode {auto} and \tcode {decltype(auto)} don't match
1737
1737
1738
1738
template <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}
1740
1740
template char g(char); // error: no matching template
1741
1741
template<> auto g(double); // OK: forward declaration with unknown return type
1742
1742
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 }
2271
2271
2272
2272
\begin {codeblock }
2273
2273
struct onlydouble {
2274
- onlydouble() = delete; // OK: but redundant
2274
+ onlydouble() = delete; // OK, but redundant
2275
2275
onlydouble(std::intmax_t) = delete;
2276
2276
onlydouble(double);
2277
2277
};
2711
2711
\begin {codeblock }
2712
2712
int f(bool b) {
2713
2713
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
2715
2715
int e = d; // undefined behavior
2716
2716
return b ? d : 0; // undefined behavior if \tcode {b} is \tcode {true}
2717
2717
}
You can’t perform that action at this time.
0 commit comments