[cfe-dev] 'const void' is considered to be an incomplete type by clang 3.5.0

Yuri yuri at rawbw.com
Mon Apr 21 11:58:34 PDT 2014


I tried to compile some Qt5 project with the latest clang-3.5.0 
(rev.206727) and got this error:

../../../../../local/include/qt5/QtCore/qmetatype.h|1319 col 27| error: 
invalid application of 'sizeof' to an incomplete type 'const void'
||         Q_STATIC_ASSERT_X(sizeof(T), "Type argument of 
Q_DECLARE_METATYPE(T*) must be fully defined");

This message, as it is worded, isn't valid because 'const void' isn't 
'incomplete'. This error was triggered by the templated class 
(template<typename T> struct IsPointerToTypeDerivedFromQObject<T*>) 
instantiated with the template argument T=const void.

clang-3.3 didn't have such issue.

Many Qt users will see this error, because this code is in a very common 
qt include file.

Yuri



More information about the cfe-dev mailing list