Relax possibly unused #include directive in one specific case

I like the "Possibly unused #include directive" but there is one case where I think an unused header include is fine. This occurs when you have a header that requires no implementation, for instance it just declares a class with no or all inline methods. In this case it is very common practice to still create a .cpp which does nothing other than #include the header. I believe some place like Bloomberg mandate Cpp files like this. This is done to ensure the header is self contained and does not require you to #include any other headers before its inclusion. I think it would be good to not warn about this at all or at least have a flag to switch off this type of warning, so the pattern is a CPP file that has no content other than a #include of a .h file in the same directory with the same name. 

1 comment

Hi David,

Sure, we'll relax the inspection -

Thanks for the suggestion!


Please sign in to leave a comment.