llvm-project
3ec64dd5 - [clang-format] Add support for additional C++ declaration specifiers in QualifierOrder (#160853)

Commit
4 days ago
[clang-format] Add support for additional C++ declaration specifiers in QualifierOrder (#160853) Fixes #60866 This PR extends clang-formats `QualifierOrder` option to support additional C++ declaration specifiers, addressing the limitation where many common qualifiers were not recognized. ## Problem Previously, `QualifierOrder` only supported a limited subset of C++ declaration specifiers: - `const`, `volatile`, `static`, `inline`, `constexpr`, `restrict`, `friend` This meant that many common C++ qualifiers like `extern`, `mutable`, `typedef`, `unsigned`, etc. were not recognized and could not be properly reordered, limiting the usefulness of the feature. ## Solution This PR adds support for 11 additional declaration specifiers: **C++98/C99 specifiers:** - `typedef` - Type definition specifier - `extern` - External linkage specifier - `mutable` - Mutable member specifier - `signed`, `unsigned` - Integer signedness specifiers - `long`, `short` - Integer size specifiers **C++11 specifiers:** - `thread_local` - Thread-local storage duration specifier - `explicit` - Explicit constructor/conversion specifier **C++20 specifiers:** - `consteval` - Immediate function specifier - `constinit` - Constant initialization specifier
Author
Parents
Loading