Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.12.7
-
None
-
f0039bd51 (dev), ef8019af7 (6.5), 8ac712968 (6.6)
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
-
QTBUG-117765 moc chokes on <concepts> from xcode13
- Closed
-
QTBUG-118086 Regression of Qt 6.5.3 over 6.5.2: Build fails on MacOS (Xcode 14.2) with error from AutoMoc in `concept`
- Closed
Gerrit Reviews
For Gerrit Dashboard: QTBUG-83160 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
493134,1 | moc: handle "L" integer suffix | tqtc/lts-6.2 | qt/tqtc-qtbase | Status: NEW | -1 | 0 |
492580,3 | moc: handle "L" integer suffix | dev | qt/qtbase | Status: MERGED | +2 | 0 |
493093,2 | moc: handle "L" integer suffix | 6.6 | qt/qtbase | Status: MERGED | +2 | 0 |
493094,2 | moc: handle "L" integer suffix | 6.5 | qt/qtbase | Status: MERGED | +2 | 0 |