Details
-
Type:
Bug
-
Status: Reported
-
Priority:
P2: Important
-
Resolution: Unresolved
-
Affects Version/s: 5.12.7
-
Fix Version/s: None
-
Component/s: Build tools: moc
-
Labels:None
Description
There is at least one distribution that add GCC's C++ headers on CPLUS_INCLUDE_PATH.
When 'moc' encounters theĀ _GLIBCXX_VISIBILITY macro, it trips and fails with a "Parse error before <token>" where token is the word just beforeĀ _GLIBCXX_VISIBILITY.
An easy fix for this problem is:
diff --git a/src/tools/moc/main.cpp b/src/tools/moc/main.cpp --- a/src/tools/moc/main.cpp +++ b/src/tools/moc/main.cpp @@ -188,6 +188,7 @@ int runMoc(int argc, char **argv) dummyVariadicFunctionMacro.arguments += Symbol(0, PP_IDENTIFIER, "__VA_ARGS__"); pp.macros["__attribute__"] = dummyVariadicFunctionMacro; pp.macros["__declspec"] = dummyVariadicFunctionMacro; + pp.macros["_GLIBCXX_VISIBILITY"] = dummyVariadicFunctionMacro; QString filename; QString output
GLIBCXX_VISIBILITY is a preprocessor macro that expands to _attribute_ which is already ignored by moc.
Should I send this patch through Gerrit?
Attachments
Issue Links
- relates to
-
QTBUG-93045 The build system should provide a moc_predefs.h with a matching __cplusplus
-
- Reported
-
-
QTBUG-73263 Qmake fails to generate moc file when using std::filesystem library
-
- Open
-