[cfe-dev] Clang compile error

Olivier Goffart ogoffart at kde.org
Fri Aug 9 06:07:52 PDT 2013


On Friday 09 August 2013 14:42:00 Robert Ankeney wrote:
> I was trying to use clang to compile some Qt 5.1.0 code and came across a
> compile error when including the file QtCore/qabstractitemmodel.h.
[...]
> The error I get using clang version 3.4 (trunk 187329) is:
> 
> bar.cpp:3:14: error: friend declaration specifying a default argument must
> be a definition
>   friend int foo(int seed = 0);
>              ^
[...] 
> This code compiles fine with clang 3.3 and gcc 4.7.3.

Hi, 

clang is correct, Qt was wrong.

Previous version of clang or gcc just did not report the error as the C++ 
standard mandate.

Qt has been already fixed:  https://codereview.qt-project.org/60150

-- 
Olivier




More information about the cfe-dev mailing list