clang-format and namespaces

Hi Daniel,

clang-format-diff is clobbering the existing indentation of namespaces in the LLVM codebase:

--- a/include/llvm/Support/ErrorHandling.h
+++ b/include/llvm/Support/ErrorHandling.h
@@ -19,7 +19,7 @@
#include <string>
``
namespace llvm {
- class StringRef;
+class StringRef;
class Twine;

CCing the list as it’s easy to miss before committing for anyone else using the tool, so heads up on that.

(Switching back to a clang-format snapshot from a couple of months ago has worked out fine to format the large-scale refactoring changes landed to ToT last week.)

Alp.

There was an intentional change to the llvm guidelines to not indent
inside namespaces. I guess one issue with clang-format is that it is a
bit too eager to move to the new style :slight_smile:

Cheers,
Rafael

There was no intentional change in behavior here, but depending on the input, clang-format might always have done this or we might have introduced a bug. Can you give me instructions to reproduce the behavior? What exactly was your input to clang-format-diff?