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

Correct indentation doesn't work with brace initialization and the conditional assignment operator

XMLWordPrintable

      "Correct indentation" doesn't work correctly if you combine brace initialization and the conditional assignment operator.

      Minimal example:
      Copy and paste the text below into the QT Creator 3.0.0 editor and try to correct the indentation (e.g. via CTRL-I).

      Input:

      int main()
      {
      int i = 1;
      int j{i?5:10};
      return 0;
      }
      
      

      Expected output:

      int main()
      {
          int i = 1;
          int j{i?5:10};
          return 0;
      }
      

      Output:

      int main()
      {
          int i = 1;
          int j{i?5:10};
                return 0;
               }
      

        1. Indentation.png
          Indentation.png
          10 kB
        2. main.cpp
          0.1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            kandeler Christian Kandeler
            uli1729 Uli
            Votes:
            5 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes