We have an issue with final classes in our code. The classes are marked as final and have a Macro that resolves to the declspec. With these classes we get information messages in the form of:
The code 'class x final :' is not handled. You can use -I or --include to add handling of this code. [class_X_Y]
Then the classes seem to be skipped.
I tried to look a bit into the code and came up with the following test that I would expect to pass, but currently it fails:
voidfinal_class_x(){constcharcode[]="class __declspec(dllexport) x final { };";{errout.str("");Tokenizertokenizer(&settings,this);std::istringstreamistr(code);tokenizer.tokenize(istr,"test.cpp");tokenizer.simplifyTokenList2();ASSERT_EQUALS("",errout.str());}}
Interestingly: If I remove the double underscore in front of declspec then the test passes.
Any suggestions what we could do about this?
Cheers,
niederb
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
We have an issue with final classes in our code. The classes are marked as final and have a Macro that resolves to the declspec. With these classes we get information messages in the form of:
The code 'class x final :' is not handled. You can use -I or --include to add handling of this code. [class_X_Y]
Then the classes seem to be skipped.
I tried to look a bit into the code and came up with the following test that I would expect to pass, but currently it fails:
Interestingly: If I remove the double underscore in front of declspec then the test passes.
Any suggestions what we could do about this?
Cheers,
niederb
Since cppcheck 2.15.0 we are getting a lot of class_X_Y information level defects. See here:
https://builds.mantidproject.org/job/pull_requests-cppcheck/62171/CppCheck/
Can someone help me understand how to resolve these?
Probably there are unknown macros like
MANTID_API_DLL
, although I couldn't immediately reproduce the issue with the first header.