MISRA Discussion Forums
Rule 14–7–3 Example errata? - 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.14 Templates (C++) (https://forum.misra.org.uk/forumdisplay.php?fid=142)
+---- Thread: Rule 14–7–3 Example errata? (/showthread.php?tid=939)



Rule 14–7–3 Example errata? - minhyuk - 07-02-2013

See 14-7-3 Example:

a function template specialization for good_tmp1 violated ODR in tmp1.cc.
Code:
// 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 Kwon@Suresoft technologies Incs.


Re: Rule 14–7–3 Example errata? - misra cpp - 11-10-2016

You are correct, the declaration in the header file should be non-defining. This will be corrected in a Technical Corrigendum