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

QtC misindents multi-line static_assert()

    XMLWordPrintable

Details

    • 0142ff8d5 (master)

    Description

      Given the following snippet:

      template <typename T>
      void foo() {
          static_assert(sizeof(T) > 0, "incomplete type");
      }
      

      When: placing the cursor after the , and hitting return

      Then: the following line is indented 8 SP w.r..t to the static_assert:

      Not even CTRL-I will change that.

      Expected: indented to one after the opening ( of the static_assert:

      Rationale: If it looks like a function, it should be formatted like a function. If I change static_assert to a function, it indents as expected:

      Attachments

        1. image-2025-03-25-09-05-22-715.png
          21 kB
          Marc Mutz
        2. image-2025-03-25-09-06-06-065.png
          21 kB
          Marc Mutz
        3. image-2025-03-25-09-08-44-084.png
          34 kB
          Marc Mutz

        Issue Links

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

          Activity

            People

              kandeler Christian Kandeler
              mmutz Marc Mutz
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes