Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-16284

Clang throws strange semantic errors in semantic analyzer

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • Qt Creator 4.4.0-rc1
    • Qt Creator 4.0.0
    • None
    • Archlinux, Clang 3.8, QtCreator 4.0.0 based on Qt 5.6.0 (GCC 6.1.1 64 bit)

    Description

      1. warning: 1 numeration values not explicitly handled in switch: TestCase2 (-Wswitch-enum)

      test1.cpp
      enum Test {
          TestCase1,
          TestCase2
      };
      int main() {
          Test t;
          switch (t) {
              case TestCase1: break;
              default: break;
          }
          return 0;
      }
      

      2. error: cannot initialize object of parameter type 'const QObject' with an expression of type 'const QWidget':

      test2.cpp
      const QWidget *w = new QWidget();
      const auto w = widget->parent(); // <- here
      

      Attachments

        Activity

          People

            kosjar Nikolai Kosjar
            vityafx Victor Polevoy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: