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

Keyword "override" gives error (C2217) when compiled as CLI in MSVC2010

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • 5.2.0 Beta1
    • 5.1.1
    • Core: Other
    • None
    • MSVC2010 C++/CLI
    • 704616605b571f126bce59243c8bc3be48f5ace8

    Description

      This issue came up for me in using any class that had QAbstractItemModel as the base class compiled as C++/CLI. Including QAbstractItemModel gave error C2217 "override requires virtual". It seems that the CLI compiler requires the virtual keyword wherever "override" is used, even though the function is implicitly virtual. While this seems to be a bug in the implementation of CLI, it prevents these classes from compiling. Adding "virtual" or removing Q_DECL_OVERRIDE from qabstractitemmodel.h removed the problem.

      As a workaround, I can trick the compiler detection defines by #defining Q_CC_INTEL, but this doesn't seem like a great solution and not sure what other consequences it will have.

      Normal C++ compilation in MSVC2010 works just fine. This is only when compiled as a managed project.

      Attachments

        Activity

          People

            thiago Thiago Macieira
            odj Orion Jankowski
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: