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

Incorrect Indentation - C++11 Template Syntax

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • Qt Creator 3.0.0-rc1
    • C/C++/Obj-C++ Support
    • None

    Description

      When declaring/defining templates in C++11, we can now avoid putting spaces between angle brackets. As an example, the following compiles:

      template <BufferTarget Target, typename Traits = BufferTraits<Target>>
      class Buffer
      {/* cursor here */
      }
      

      Suppose the cursor is set right behind the the opening curly brace. When pressing 'Return' or 'Enter', the assumed effect is that the cursor will be placed on the following line, with the appropriate indentation relative to the opening curly brace.

      Currently, however, Qt Creator will indent the cursor to a position aligned with 'Target', right after the second opening angle bracket. This is extremely annoying.

      The work-around is to simply use C++03 syntax. Then the indentation is fine.

      Attachments

        Issue Links

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

          Activity

            People

              kosjar Nikolai Kosjar
              thokra Thomas Kranz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes