[Development] Q_COMPILER_RANGE_FOR not supported by/defined for VS2012 and VS2013 ?

Michael Möllney mail at michaelmoellney.de
Mon Feb 29 18:33:39 CET 2016


(Sorry if this is not the right place ... or was handled before ... is there a search over mailing list somewhere ?)

I'm looking what C++11 feature I could use in my further cross platform development.
For my production code there is a potpourri of VS2005 / VS2010 / gcc 4.5 / gcc 4.7 that is used for development.
Some of them I would like to throw out (or even all) .... maybe I should skip to newer ones....

So I was looking around to see, what C++11 feature would be usable in what compiler version.

I was spying what Qt knows about this and found the file:
qcompilerdetection.h
defining a lot of
Q_COMPILER_XXXXX
depending on the version of the compiler.... Bingo

What confused me was that
Q_COMPILER_RANGE_FOR
is first defined for VS2015, the older ones are not setting this define.

Following the discussion in this list about what compiler should be supported in what Qt version: 5.7, 5.8, ...
and seeing in gerrit how many foreach are replaced by C++11 range for I hope that Q_COMPILER_RANGE_FOR
should have been defined for VS2012 and up.

At least this is what can be found on:
http://en.cppreference.com/w/cpp/compiler_support
https://msdn.microsoft.com/en-us/library/hh567368.aspx

So is it an error in
https://github.com/qtproject/qtbase/blob/5.7/src/corelib/global/qcompilerdetection.h#L917
?

Is the test
https://github.com/qtproject/qtbase/blob/5.7/tests/auto/other/compiler/tst_compiler.cpp#L991
skipped for all VS compilers older than VS2015?

Or does Qt know something about VS2012 and VS2013 that can not be found on the two sites I mentioned, so range for should not be used for these...?

Cheers,
Michael




More information about the Development mailing list