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

Incorrect indentation with simple macros

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • Qt Creator 3.5.0, Qt Creator 4.6.0 , Qt Creator 4.13.0
    • C/C++/Obj-C++ Support
    • OS X 10.10.5 – 10.14.6

    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

        Activity

          People

            kandeler Christian Kandeler
            szhorvat Szabolcs Horvát
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: