[Development] #error for unreleased MSVC versions

Thiago Macieira thiago.macieira at intel.com
Thu Oct 24 19:05:43 CEST 2013


On quinta-feira, 24 de outubro de 2013 17:53:24, Thiago Macieira wrote:
> [erase text I had written]
> 
> After writing an example, I realise that there is a solution and it's the
> same  I'm implementing for GCC: we need the qstring_compat.cpp (for
> example) that I added in
>         https://codereview.qt-project.org/68300
> 
> It's not exactly the same problem, but it is quite similar. It involves an 
> upgrade and new C++11 features being supported. I wrote the above for an 
> upgrade of the compiler, while keeping Qt the same. But it turns out it
> also  applies for upgrading Qt and keeping the compiler the same. Sounds
> obvious now that I put it into words.
> 
> Given the lower urgency of the problem, I withdraw my request to make this
> an  #error.

FYI, here's the case I was thinking of:

See the changes leading to the contribution above.

Right now, no MSVC version (up to and including 2013) supports ref qualifiers.

Suppose we do add the ref-qualified versions of toLatin1() to QString in 
Qt 5.3.

Then suppose MSVC 2014 is announced to include the feature. Then we go and add 
the Q_COMPILER_REF_QUALIFIERS define to Qt 5.4. Since no one was compiling Qt 
with that unreleased compiler before it got released, we decide that we don't 
have to provide compatibility.

So Qt 5.4 comes with official support for MSVC 2014, with 
QString::toLatin1() &&, QString::toLatin1() const &, but no unqualified 
QString::toLatin1() const.

That means Qt 5.4 is binary incompatible with Qt 5.3.


Now, the solution for that is the same as what we'll need to do[*] for GCC. So 
it doesn't cost us to provide it. But I'd like to still reserve us the right 
to do that. We've done it before: for the QXmlStreamReader move to QtCore, on 
64-bit Macs.

[*] pending analysis of what the MSVC ABI for ref-qualified functions will be
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20131024/2c5e143a/attachment.sig>


More information about the Development mailing list