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

Incorrect indentation with simple macros

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: Not Evaluated
    • Resolution: Unresolved
    • Affects Version/s: Qt Creator 3.5.0, Qt Creator 4.6.0
    • Fix Version/s: None
    • Component/s: C/C++/Obj-C++ Support
    • Labels:
      None
    • Environment:
      OS X 10.10.5

      Description

      In one of my source files, suddenly Creator wants to indent everything by 6 indents (24 spaces). This happens at any location in the source file beyond a certain point.

      I managed to create the following minimal example (which I cannot reduce further):

      #define GGG(ARG) void g() { }
      
      GGG(ARG)
      
      inline int operator >> (int, int) { }
      
      #define FFF void f() {}
      
      FFF
      

      Put this in a .h file, save it, move the cursor right after FFF and press enter. Creator will indent everything by 6 indents.

      Please ignore whether the code makes sense, it's just a minimal example. The actual code compiles fine and uses simple macros with arguments to avoid repetitive typing when interfacing with a C library.

        Attachments

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

          Activity

            People

            • Assignee:
              kosjar Nikolai Kosjar
              Reporter:
              szhorvat Szabolcs Horvát
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Gerrit Reviews

                There are no open Gerrit changes