From e70508509ca4b668e4d9bc68ee09e4197fd84265 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 2 Feb 2022 08:06:15 +0100 Subject: shiboken6: Consider .h files as C++ Previously, shiboken6 and dependent tools would consider .h files as C (working around by creating a temporary header). This can be worked around by passing -x c++ to clang. Task-number: PYSIDE-1802 Change-Id: I5c0d9ef2d6a11a8409be979ccdb52e5eca08656a Reviewed-by: Qt CI Bot Reviewed-by: Christian Tismer (cherry picked from commit e6a5b97211bbeac737ade08467712b4ddcb0586d) Reviewed-by: Qt Cherry-pick Bot --- sources/shiboken6/ApiExtractor/clangparser/clangparser.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/shiboken6/ApiExtractor/clangparser/clangparser.cpp b/sources/shiboken6/ApiExtractor/clangparser/clangparser.cpp index 15be8f5a4..8100cab77 100644 --- a/sources/shiboken6/ApiExtractor/clangparser/clangparser.cpp +++ b/sources/shiboken6/ApiExtractor/clangparser/clangparser.cpp @@ -271,7 +271,9 @@ static CXTranslationUnit createTranslationUnit(CXIndex index, "-Wno-expansion-to-defined", // Workaround for warnings in Darwin stdlib, see // https://github.com/darlinghq/darling/issues/204 #endif - "-Wno-constant-logical-operand" + "-Wno-constant-logical-operand", + "-x", + "c++" // Treat .h as C++, not C }; QByteArrayList clangArgs; -- cgit v1.2.3