In trying to have code written to be like composing for a client, I have been using lint. For C++ I use cpplint. Here is the reference on which cpplint is based.
One line says "Friend declarations should always be in the private section ..." (http://google-styleguide.googlecode....laration_Order)