13-05-2022, 01:51 PM
The rule could be made clearer, but the intent was definitely to only cover templates that *are* instantiatable. Therefore, this could be seen as a false positive against a tool as there is no definition of SomeClass.
However, given modern C++ techniques, the presence of templates that are not intended to be instantiated (with or without definitions) makes this kind of rule Undecidable at best, with questionable value.
With this in mind, the rule is under consideration of the next version.
However, given modern C++ techniques, the presence of templates that are not intended to be instantiated (with or without definitions) makes this kind of rule Undecidable at best, with questionable value.
With this in mind, the rule is under consideration of the next version.
Posted by and on behalf of
the MISRA C++ Working Group
the MISRA C++ Working Group