Issue 168721
Summary clang format 21.1.5 does not create a comment at the end of a namespace in a header file
Labels clang
Assignees
Reporter NikBarykin
    Clang format of version 21.1.5 creates a comment at the end of a namespace in a cpp file but does not do the same inside a header file. It can be forced to create a comment by placing an empty comment at the end of a namespace and invoking clang-format. This looks kinda inconvenient to me. 

```
➜ cat foo.h
namespace n {
void foo();
}
➜ cat foo.cpp
namespace n {
void foo() {}
}
➜ clang-format --version
clang-format version 21.1.5
➜ clang-format foo.cpp
namespace n {
void foo() {}
} // namespace n
➜ clang-format foo.h
namespace n {
void foo();
}
➜ cat refined_foo.h
namespace n {
void f();
} //
➜ clang-format refined_foo.h
namespace n {
void f();
} // namespace n
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to