Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
5.6.1
-
None
-
{noformat}
$ clang --version
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.4.0{noformat}
Description
The qCDebug(category, ...) macro expands to QMessageLogger(...).debug(_VA_ARGS_). This is fine when using the printf-style syntax but does not compile when using it as stream.
Happens with clang on Mac. Small reproducer attached - it is enough to use the strem version of qCDebug() in any Qt app and compile with
-pedantic -Werror
Workaround: disable the specific diagnostic with
-Wno-gnu-zero-variadic-macro-arguments
About the cause: as far as I understand, the macro expansion violates C++11 standard as a variadic macro argument can be empty only if there is the same number of argument in the macro call (while here there's the category, so it's 1).
A related bug: QTBUG-37283