This narrows clang-format's spacing heuristic for `identifier ::`. Previously, clang-format preserved existing whitespace before `::` after any identifier, which caused inputs like: ```c++ template <typename T> auto mem = &T :: member; ``` to format as: ```c++ template <typename T> auto mem = &T ::member; ``` This patch preserves that whitespace only for identifiers that look like object-like macros, such as the existing `ALWAYS_INLINE ::std::string` case. Ordinary identifiers now format as expected: ```c++ &T :: member ``` becomes ```c++ &T::member ``` Test: - `./build-cir/tools/clang/unittests/Format/FormatTests --gtest_filter=FormatTest.NestedNameSpecifiers` Fixes #188754
23 KiB
23 KiB