First: If this is the wrong forum, please move. The only relevant static code analysis forum I found was in the archived section.
In VS 2012 we are experiencing compiler errors when analyzing code that contains Qt.
Simply including
#include "QtGui\QtGui"
compiles fine, but if we use the static code analysis, then we suddenly get compiler(!) errors like:
Error 1 error C2171: '!' : illegal on operands of type ''unknown-type'' d:\local3rdpartyrepository\qt\5.2.1\win32\vs2012\include\qtcore\qarraydataops.h 399
There are several users with this issue:
But no proper solution to this.
Using #pragma warning disable, e.g:
#include <codeanalysis\warnings.h>#pragma warning( push )#pragma warning ( disable : ALL_CODE_ANALYSIS_WARNINGS )#include "QtGui\QtGui"#pragma warning( pop )
Does not work as this affects code violations but not compiler errors.
Trying /analyze:only did not work either. How is this suppose to work? Does the static code analyzer use a different toolchain for parsing c++ code and cannot handle the meta-programming during analysis?
Regards