Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.3.0
-
None
-
Windows. Built on Windows 7 64 bit, with AMD64 as the target.
-
16dccb24e4e7fb6332f672e1572e7ca359f794c5
Description
When using MSVC 2012 (cl 17.0) or 2013 (cl 18.0) with the option "/Za", i.e. disable extensions, many types that use QFlag/QFlags fail to compile.
An example is the QDir class.
This originates from the classes declaring enumerations with a mix of positive and negative integers (usually a -1 is declared, e.g. QDir::NoFilter).
- The enumeration values are passed to the QFlags constructor.
- A QFlag is implicitly constructed for conversion.
- The QFlag has multiple constructors, for int and uint, and, because the enumeration matches both, this causes an ambiguity.
This was not an issue with Qt4 because QFlag only had an int constructor.
Attachments
For Gerrit Dashboard: QTBUG-39700 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
88021,4 | Attempt to work with Visual Studio in -Za (strict ANSI) mode | 5.3 | qt/qtbase | Status: MERGED | +2 | 0 |