Review Request 117680: Fix linker errors with MSVC

Alexander Richardson arichardson.kde at googlemail.com
Mon Apr 21 21:40:38 UTC 2014


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

Ship it!


I only tested with MSVC 2013, so I didn't run into this issue

- Alexander Richardson


On April 21, 2014, 8:35 p.m., Nicolás Alvarez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/117680/
> -----------------------------------------------------------
> 
> (Updated April 21, 2014, 8:35 p.m.)
> 
> 
> 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/d8258392/attachment.html>


More information about the Kde-frameworks-devel mailing list