- 
    
Bug
 - 
    Resolution: Done
 - 
    
P3: Somewhat important
 - 
    5.15.3, 5.15.4
 - 
    None
 - 
    Qt binaries pre-compiled for MSVC 2019 32-bit; Visual Studio 2019 16.9.5; msvc compiler version 19.28.29915 for x86;
 
- 
        
 - 
        93dad2bf91d f921b42f34 (qt/qtbase/dev) f921b42f34 (qt/tqtc-qtbase/dev) e2ff48441b (qt/qtbase/6.4) e2ff48441b (qt/tqtc-qtbase/6.4)
 
Visual Studio 16.9.5 fixed a bug that failed to warn on incorrect placement of attributes. Consequently, usages of QT_DEPRECATED_X together with Q_REQUIRED_RESULT are now producing compiler warnings. This happens with QColor::light and dark, and QPainterPath::subtractedInverted in my env/codebase, but maybe also others.
Specifically, the expansion from (for example)
QT_DEPRECATED_X("Use QColor::lighter() instead") Q_REQUIRED_RESULT QColor light(int f = 150) const noexcept;
into
__declspec(deprecated("Use QColor::lighter() instead")) [[nodiscard]] QColor light(int f = 150) const noexcept;
generates
warning C5240: 'nodiscard': attribute is ignored in this syntactic position
 
 VS now supports the correct syntax of
[[deprecated("Use QColor::lighter() instead")]] [[nodiscard]] QColor light(int f = 150) const noexcept;
which looks was already done specifically for enums in msvc (qcompilerdetection.h line 1153)
- resulted from
 - 
                    
QTBUG-63658 ICC: 'attributes may not appear here ... static Q_REQUIRED_RESULT bool qWaitFor(Functor predicate, int timeout = 5000)' errors for builds on Windows
-         
     - Closed
 
 -         
 
| For Gerrit Dashboard: QTBUG-93748 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V | 
| 417723,5 | MSVC: Remove dead Q_DECL_DEPRECATED* definitions | dev | qt/qtbase | Status: MERGED | +2 | 0 | 
| 418244,2 | MSVC: Remove dead Q_DECL_DEPRECATED* definitions | 6.4 | qt/qtbase | Status: MERGED | +2 | 0 |