Parse code by clang with the error about Q_COMPILER_UNICODE_STRINGS
-
Hello, I try to parse a simple code by clang (llvm 7.0.0).
It must include <QObject> to properly parse Q_OBJECT macro and so on. When I did, I got errors:C:\Qt\Qt5.7.0\5.7\mingw53_32\include\QtCore/qtypetraits.h:251:19: error: redefinition of 'is_integral<unsigned short>' C:\Qt\Qt5.7.0\5.7\mingw53_32\include\QtCore/qtypetraits.h:252:19: error: redefinition of 'is_integral<unsigned int>' C:\Qt\Qt5.7.0\5.7\mingw53_32\include\QtCore/qtypeinfo.h:325:1: error: redefinition of 'QTypeInfo<unsigned short>' C:\Qt\Qt5.7.0\5.7\mingw53_32\include\QtCore/qtypeinfo.h:326:1: error: redefinition of 'QTypeInfo<unsigned int>' C:\Qt\Qt5.7.0\5.7\mingw53_32\include\QtCore/qflags.h:49:10: fatal error: 'initializer_list' file not found
There is a problem:
template<> struct is_integral<unsigned short> : true_type { }; template<> struct is_integral<unsigned int> : true_type { }; ... #if defined (Q_COMPILER_UNICODE_STRINGS) template<> struct is_integral<char16_t> : true_type { }; template<> struct is_integral<char32_t> : true_type { }; #endif
It works without clang, but clang initiate the using of Q_COMPILER_UNICODE_STRINGS. That fact breaks the code.. Is there a bug (there is no if/else branch in the code for this case)?
-
I don't think anybody tests Qt with clang on Windows, so it is likely a bug. Feel free to check / report on Qt bug tracker bugreports.qt.io
-
I don't think anybody tests Qt with clang on Windows, so it is likely a bug. Feel free to check / report on Qt bug tracker bugreports.qt.io
-
@aha_1980 said in Parse code by clang with the error about Q_COMPILER_UNICODE_STRINGS:
@sierdzio ... but before it would be useful to upgrade to Qt 5.12.x
haha, right, I missed that bit :-)