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

[ClangFormat] Incorrect indentation of a block after one-line if/try

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P2: Important
    • Qt Creator 12.0.0
    • Qt Creator 4.10.0-beta1
    • C/C++/Obj-C++ Support
    • None
    • Kubuntu 19.04 x86-64
    • Linux/X11

    Description

      Try typing the following code:

      void foo()
      {
      	if (true) try
      		{
      			
      		}
      }
      

      Note that `if` and `try` keywords are on the same line. When I type the opening brace on the next line after `try` it gets indented one level deeper than `if`. I would expect it to have the same level of indentation.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            lastique Andrey Semashev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes