Understanding -Weffc++
Consider the following program: #include <string> struct S { S (){} private: void *ptr = nullptr; std::string str = ""; }; int main(){} This, when compiled with -Weffc++ on GCC 4.7.1, will spit out: warning: 'struct S' has pointer data members [-Weffc++] warning: but does not override 'S(const S&)' [-Weffc++] warning: or 'operator=(const S&)' [-Weffc++] That's no problem normally, except for a couple things with this example: If I comment out any of the constructor, the pointer declaration, or the string declaration, the warning disappears. This is odd because you'd think the pointer alone