MISRA Discussion Forums
Rule 3-2-3 and friend Declarations - Printable Version

+- MISRA Discussion Forums (https://forum.misra.org.uk)
+-- Forum: MISRA C++ (https://forum.misra.org.uk/forumdisplay.php?fid=18)
+--- Forum: MISRA C++:2008 rules (https://forum.misra.org.uk/forumdisplay.php?fid=19)
+---- Forum: 6.3 Basic concepts (C++) (https://forum.misra.org.uk/forumdisplay.php?fid=132)
+---- Thread: Rule 3-2-3 and friend Declarations (/showthread.php?tid=777)



Rule 3-2-3 and friend Declarations - gs - 30-09-2010

Am I correct in presuming rule 3-2-3 does not apply to friend declarations? For example, if I declare a class type in a header file, am I permitted to declare that class as a friend of another type in a different file?


Re: Rule 3-2-3 and friend Declarations - misra cpp - 11-10-2016

This rule does not preclude the use of friend or forward reference statements, but these must be in a separate header file.

A future edition may reconsider this point