CMake: Fix clang build type mismatch detection with Clang 13.0

Clang 13.0 has made CommonOptionsParser's constructor protected
and the test fails to build, and clang is considered as being
not found.

Change-Id: I7b28b5104bcb6541f3ee9c4bf56e9bb1898d58af
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Cristian Adam
2021-09-30 17:51:56 +02:00
parent c75df591ed
commit b8609be931

View File

@@ -34,7 +34,13 @@ if (WIN32 AND TARGET clangTooling)
llvm::cl::OptionCategory CheckToolCategory("check tool options");
int main(int argc, const char **argv)
{
CommonOptionsParser OptionsParser(argc, argv, CheckToolCategory);
class Parser : public CommonOptionsParser {
public:
Parser(int &argc, const char **argv, llvm::cl::OptionCategory &Category) :
CommonOptionsParser(argc, argv, Category) {}
};
Parser OptionsParser(argc, argv, CheckToolCategory);
ClangTool Tool(OptionsParser.getCompilations(),
OptionsParser.getSourcePathList());
return 0;