1diff --git a/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp b/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp
2index add278a..2626eb6 100644
3--- a/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp
4+++ b/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp
5@@ -349,11 +349,15 @@ QByteArrayList emulatedCompilerOptions()
6
7 // Append the c++ include paths since Clang is unable to find
8 // <type_traits> etc (g++ 11.3).
9- const HeaderPaths gppPaths = gppInternalIncludePaths(compilerFromCMake(QStringLiteral("g++")));
10+ const HeaderPaths gppPaths = gppInternalIncludePaths(QStringLiteral("g++"));
11 for (const HeaderPath &h : gppPaths) {
12- if (h.path.contains("c++")
13- || h.path.contains("sysroot")) { // centOS
14+ // PySide2 requires that Qt headers are not -isystem
15+ // https://bugreports.qt.io/browse/PYSIDE-787
16+ if (!h.path.contains("-qt")) {
17+ // add using -isystem
18 headerPaths.append(h);
19+ } else {
20+ headerPaths.append({h.path, HeaderType::Standard});
21 }
22 }
23 #else