Review Request 117680: Fix linker errors with MSVC

Nicolás Alvarez nicolas.alvarez at gmail.com
Mon Apr 21 18:35:25 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/117680/
-----------------------------------------------------------

Review request for KDE Frameworks.


Repository: kservice


Description
-------

KSycocaEntry has its copy ctor disabled with Q_DISABLE_COPY. For some reason MSVC emits a copy ctor for KService (a subclass), which calls the copy ctor of KSycocaEntry. This compiles, because KService is a friend of KSycocaEntry, so the copy ctor is accessible despite being private. However, it fails to link because the private copy ctor is not defined anywhere. The same happens with the assignment operator.

Fixed by disabling copy on KService too, so that the compiler doesn't try to emit a copy constructor or assignment operator for it.


Diffs
-----

  src/services/kservice.h bfd6fce 

Diff: https://git.reviewboard.kde.org/r/117680/diff/


Testing
-------

Builds on Windows, MSVC2010. Still builds on gcc/Linux.

I didn't test newer MSVC versions, but I think MSVC2013 should be working even without this patch, as Q_DISABLE_COPY will use =delete instead of declaring the functions private.


Thanks,

Nicolás Alvarez

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140421/8ce9bcd7/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list