[cfe-dev] Compile errors when building kde-runtime
silvas at purdue.edu
Mon May 7 16:44:13 PDT 2012
It looks like its the usual "most vexing parse", with an astonishing
cascade of diagnostics caused by it.
It's a regrettable quirk of C++'s syntax, even has its own wikipedia page <
Basically, this is the problem:
warning: parentheses were disambiguated as a function declarator
Soprano::Node dateTime( Soprano::LiteralValue(
Clang sums it up quite nicely. That declaration declares a function
`dateTime`, which is causing all the problems (failure to find overloads,
etc.). An extra pair of parens should make the program mean what you
intended (unless there's something else going on that I missed among the
cascade of errors):
Soprano::Node dateTime( Soprano::LiteralValue(QDateTime::currentDateTime() )
Soprano::Node dateTime( (Soprano::LiteralValue(QDateTime::currentDateTime())
This is one reason why C++11's "uniform initialization syntax" is a win. It
avoids this problem by using braces.
On Fri, May 4, 2012 at 6:06 PM, Shaun Reich <sreich at kde.org> wrote:
> reproducible with clang from today's git.
> Shaun Reich,
> KDE Software Developer (kde.org)
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev