[Kde-bindings] smoke generator: virtual override return type missing 'const'

Michael Lawrence lawrence.michael at gene.com
Thu Feb 6 13:16:56 UTC 2014


Hit an issue when trying to compile bindings to QtQuick with clang:

QSGMaterial has:

virtual char const *const *attributeNames() const = 0;

Smoke overrides this with:

virtual char* const * attributeNames() const {

And clang fails with:

type of virtual function 'attributeNames' is not covariant with the return
type of the function it overrides ('char *const *' is not derived from
'const char *const *')

I'm wondering if this has anything to do with the unconventional (but
arguably best practice) specification of the type as "char const * const *"
instead of "const char * const *". Kind of funny how clang normalizes this
back to "const char * const *". From looking at the code, it looks like the
parser may be missing that the type (char) is const. But I can't figure out
why. That code is beyond me.

Thanks for any help,
Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20140206/16aaeecf/attachment.html>


More information about the Kde-bindings mailing list