jeudi 5 décembre 2019

Cppcheck syntax error on Template class having a function with template paramter

Anyone knows how I can fix this Cppcheck syntax error (no more information than "syntax error") or if it is a false positive (maybe due to options used), I looked at template tutorials and documentations and didn't find any similar usage, the code is:

template<typename T>
template<class Archive> // Here is the Cppcheck syntax error
void MyItemContainer<T>::serialize(Archive & ar, const unsigned int version)
{
    ....
}

I'm using :

  • g++ (SUSE Linux) 8.2.1 20180831 [gcc-8-branch revision 264010]
  • Cppcheck 1.82 (this is the last available version on openSUSE Leap 15), I have successfully build 1.89 version but I cannot run it, with same parameters as I do with 1.82 version I have "cppcheck: Failed to load library configuration file 'std.cfg'. File not found" error
  • Cppcheck command is: cppcheck MyItemContainer.h --force --platform=unix64 --enable=warning --xml-version=2 --verbose --error-exitcode=0 --std=c++11 --language=c++

Thanks

Aucun commentaire:

Enregistrer un commentaire