http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53184
--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> --- I've just come across a case where an option to disable that warning would be handy: We have a foo.cc file defining some classes in an anon namespace. A unit test does #include "foo.cc" so it can test the implementation details, which makes GCC (quite rightly) think it's a header file. In this case no other translation unit is going to include the "header" and so there will be no ODR violation, but we can't disable the warning so have to resort to macros to give the namespace a name when used in this way, which means the test isn't testing the real code.