-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Bug
Copy link
Labels
Description
clang-format version 20.1.0 (https://github.com/llvm/llvm-project.git 24a30da) formatted code like this:
// ---
// IndentWidth: 4
// PenaltyReturnTypeOnItsOwnLine: 800
class MyClass {
template <bool abool, // a comment
bool anotherbool>
static inline std::pair<size_t, MyCustomTypeeeeeeeee>
myfunccccccccccccccccccccccc(const char *buf, const char *&err);
};
whereas clang-format version 21.1.0-rc3 (https://github.com/llvm/llvm-project.git 6096d35) splits the std:: from the rest of the return type:
// ---
// IndentWidth: 4
// PenaltyReturnTypeOnItsOwnLine: 800
class MyClass {
template <bool abool, // a comment
bool anotherbool>
static inline std::
pair<size_t, MyCustomTypeeeeeeeee> myfunccccccccccccccccccccccc(
const char *buf, const char *&err);
};
i could see this being "as designed," but what's odd is that if the comment in the member template is removed, the formatting 21.1.0-rc3 does changes back to how clang version 20.1.0 did it:
// ---
// IndentWidth: 4
// PenaltyReturnTypeOnItsOwnLine: 800
class MyClass {
template <bool abool, bool anotherbool>
static inline std::pair<size_t, MyCustomTypeeeeeeeee>
myfunccccccccccccccccccccccc(const char *buf, const char *&err);
};