You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class [[gnu::warn_unused]] S1 {
public:S1() {}
};
class [[gnu::warn_unused]] S2 {
public:S2() = default;
};
class [[gnu::warn_unused]] S3 {
public:S3();
};
class [[gnu::warn_unused]] S4 {
};
classC {
public:C() {}
private:const S1 s1; // no warningconst S2 s2; // warningconst S3 s3; // no warningconst S4 s4; // warning
};
<source>:25:14: warning: private field 's2' is not used [-Wunused-private-field]
25 | const S2 s2; // warning
| ^
<source>:27:14: warning: private field 's4' is not used [-Wunused-private-field]
27 | const S4 s4; // warning
| ^