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

Warning M115 when using blocks for switch/case and 'let'

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: Qt Creator 4.12.2, Qt Creator 4.13.0
    • Fix Version/s: None
    • Component/s: Quick / QML Support
    • Environment:
      Qt Creator 4.12.2
      Based on Qt 5.14.2 (Clang 10.0 (Apple), 64 bit)
      Built on Jun 2 2020 01:16:16
      From revision 33c5ff216a

      Description

      When creating a switch/case statement that uses blocks inside a case the warning

      Do not use stand-alone blocks. (M115)

      is showed.

      e.g.

              switch ( var )
              {
                  case 1:
                  {
                      break;
                  }
                  case 2:
                  {
                      break;
                  }
                  default:
                  {
                      break;
                  }
              }
      

      Many companies enforce using blocks inside cases as a coding standard.

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              tjenssen Tim Jenssen
              Reporter:
              israelins85 Israel Lins Albuquerque
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes