Details
-
Bug
-
Resolution: Incomplete
-
Not Evaluated
-
None
-
5.3.0 Alpha
-
None
-
gcc 4.8.1
Description
Commit b8a38a6737acd670d92197ca5b009590d9fd8a9c breaks compilation of the following code if Q_COMPILER_VARIADIC_MACROS is not defined:
Q_DECLARE_LOGGING_CATEGORY(testlog) Q_LOGGING_CATEGORY(testlog, "HelloWorld") int main() { qCDebug(testlog) << "Hello"; return 0; }
The two macros are resolved to:
extern const QLoggingCategory &testlog(); const QLoggingCategory &testlog() { static const QLoggingCategory category("HelloWorld"); return category; }
and the
qCDebug(testlog) << "Hello";
call is resolved to
QMessageLogger("main.cpp", 12, __PRETTY_FUNCTION__).debug(testlog)
because of the new
#define qCDebug qDebug
in qloggingcategory.h
This code however doesn't compile, because you'd have to pass 'testlog()' and
not 'testlog' as parameter to 'debug()'.