Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-72073

[REG 5.11->5.12] MSVC 64bit: Compile error C2666 when using std::bitset with QtCore

    XMLWordPrintable

Details

    • Windows

    Description

      If using std::bitset with include <QtCore>, MSVC build will be failed as below.

      C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\include\bitset(270): error C2666: 'operator /': 10 overloads have similar conversions
      C:\Qt\5.12.0\msvc2017_64\include\QtCore/qsize.h(364): note: could be 'const QSizeF operator /(const QSizeF &,qreal)'
      C:\Qt\5.12.0\msvc2017_64\include\QtCore/qsize.h(194): note: or       'const QSize operator /(const QSize &,qreal)'
      c:\qt\5.12.0\msvc2017_64\include\qtcore\qmargins.h(427): note: or       'QMarginsF operator /(const QMarginsF &,qreal)'
      c:\qt\5.12.0\msvc2017_64\include\qtcore\qmargins.h(213): note: or       'QMargins operator /(const QMargins &,qreal)'
      c:\qt\5.12.0\msvc2017_64\include\qtcore\qmargins.h(207): note: or       'QMargins operator /(const QMargins &,int)'
      C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(205): note: or       'double operator /(int,qfloat16) noexcept'
      C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(205): note: or       'double operator /(qfloat16,int) noexcept'
      C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(195): note: or       'float operator /(float,qfloat16) noexcept'
      C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(195): note: or       'float operator /(qfloat16,float) noexcept'
      C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(194): note: or       'double operator /(double,qfloat16) noexcept'
      C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(194): note: or       'double operator /(qfloat16,double) noexcept'
      C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(193): note: or       'long double operator /(long double,qfloat16) noexcept'
      C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(193): note: or       'long double operator /(qfloat16,long double) noexcept'
      C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(176): note: or       'qfloat16 operator /(qfloat16,qfloat16) noexcept'
      C:\Qt\5.12.0\msvc2017_64\include\QtCore/qpoint.h(402): note: or       'const QPointF operator /(const QPointF &,qreal)'
      C:\Qt\5.12.0\msvc2017_64\include\QtCore/qpoint.h(206): note: or       'const QPoint operator /(const QPoint &,qreal)'
      C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\include\bitset(270): note: or       'built-in C++ operator/(::size_t, )'
      C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\include\bitset(270): note: while trying to match the argument list '(::size_t, )'
      C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\include\bitset(266): note: while compiling class template member function 'std::bitset<8> &std::bitset<8>::set(::size_t,bool)'
      C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\include\bitset(39): note: see reference to function template instantiation 'std::bitset<8> &std::bitset<8>::set(::size_t,bool)' being compiled
      ..\Qt5.12.0-C2666\main.cpp(7): note: see reference to class template instantiation 'std::bitset<8>' being compiled
      C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\include\bitset(272): error C2666: 'operator /': 10 overloads have similar conversions
      C:\Qt\5.12.0\msvc2017_64\include\QtCore/qsize.h(364): note: could be 'const QSizeF operator /(const QSizeF &,qreal)'
      C:\Qt\5.12.0\msvc2017_64\include\QtCore/qsize.h(194): note: or       'const QSize operator /(const QSize &,qreal)'
      c:\qt\5.12.0\msvc2017_64\include\qtcore\qmargins.h(427): note: or       'QMarginsF operator /(const QMarginsF &,qreal)'
      c:\qt\5.12.0\msvc2017_64\include\qtcore\qmargins.h(213): note: or       'QMargins operator /(const QMargins &,qreal)'
      c:\qt\5.12.0\msvc2017_64\include\qtcore\qmargins.h(207): note: or       'QMargins operator /(const QMargins &,int)'
      C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(205): note: or       'double operator /(int,qfloat16) noexcept'
      C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(205): note: or       'double operator /(qfloat16,int) noexcept'
      C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(195): note: or       'float operator /(float,qfloat16) noexcept'
      C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(195): note: or       'float operator /(qfloat16,float) noexcept'
      C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(194): note: or       'double operator /(double,qfloat16) noexcept'
      C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(194): note: or       'double operator /(qfloat16,double) noexcept'
      C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(193): note: or       'long double operator /(long double,qfloat16) noexcept'
      C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(193): note: or       'long double operator /(qfloat16,long double) noexcept'
      C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(176): note: or       'qfloat16 operator /(qfloat16,qfloat16) noexcept'
      C:\Qt\5.12.0\msvc2017_64\include\QtCore/qpoint.h(402): note: or       'const QPointF operator /(const QPointF &,qreal)'
      C:\Qt\5.12.0\msvc2017_64\include\QtCore/qpoint.h(206): note: or       'const QPoint operator /(const QPoint &,qreal)'
      C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\include\bitset(272): note: or       'built-in C++ operator/(::size_t, )'
      C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\include\bitset(272): note: while trying to match the argument list '(::size_t, )'
      

       

      This failure is appeared from Qt 5.12. Qt 5.11 can build without error.

       

       

       

      Attachments

        Issue Links

          Activity

            People

              thiago Thiago Macieira
              akizawa Akihito Izawa
              Votes:
              3 Vote for this issue
              Watchers:
              17 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: