MISRA Discussion Forums

Full Version: Rule 14–7–3 Example errata?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
See 14-7-3 Example:

a function template specialization for good_tmp1 violated ODR in tmp1.cc.
// tmp1.h
template  void good_tmp1 ( ) { }

// tmp1.cc
#include "tmp1.h"
template  void good_tmp1 ( ) { }

I think function template specialization must be forward declaration in header file.
any reason for that?

Best Regards,
Minhyuk [email protected] technologies Incs.
You are correct, the declaration in the header file should be non-defining. This will be corrected in a Technical Corrigendum