clang-format: Fix namespace end comments for namespaces with attributes and macros.
Fixes PR39247.
While here, also make C++20 `namespace A::inline B::inline C` nested
inline namespaced definitions work.
Before:
#define DEPRECATE_WOOF [[deprecated("meow")]]
namespace DEPRECATE_WOOF woof {
void f() {}
} // namespace DEPRECATE_WOOFwoof
namespace [[deprecated("meow")]] woof {
void f() {}
} // namespace [[deprecated("meow")]]woof
namespace woof::inline bark {
void f() {}
} // namespace woof::inlinebark
Now:
#define DEPRECATE_WOOF [[deprecated("meow")]]
namespace DEPRECATE_WOOF woof {
void f() {}
} // namespace woof
namespace [[deprecated("meow")]] woof {
void f() {}
} // namespace woof
namespace woof::inline bark {
void f() {}
} // namespace woof::inline bark
(In addition to the fixed namespace end comments, also note the correct
indent of the namespace contents.)
Differential Revision: https://reviews.llvm.org/D65125
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366831
91177308-0d34-0410-b5e6-
96231b3b80d8