`clang-format` Position of comments on closing braces - Stack Overflow

admin2025-04-27  3

I have a code with a lot of nested blocks. They all end together, and for reference, each } has its own comment:

        } // end of switch(var)
    } // loop over cond2
} // end if for cond1

The clang-format "suddenly" aligned those comments:

        } // end of switch(var)
    }     // loop over cond2
}         // end if for cond1

What is the option in .clang-format which controls this?

转载请注明原文地址:http://anycun.com/QandA/1745705235a91075.html