Before this patch, the code:
```
template <class T>
concept a_concept = X<>;
namespace B {
struct b_struct {};
} // namespace B
```
with config:
```
NamespaceIndentation: None
```
was wrongly indented inside namespace B, giving:
```
template <class T>
concept a_concept = X<>;
namespace B {
struct b_struct {};
} // namespace B
```
Fixes https://github.com/llvm/llvm-project/issues/50645
Reviewed By: MyDeveloperDay, owenpan
Differential Revision: https://reviews.llvm.org/D116008
break;
case tok::kw_concept:
parseConcept();
- break;
+ return;
case tok::kw_requires:
parseRequires();
break;
"} // namespace in\n"
"} // namespace out",
Style));
+
+ Style.NamespaceIndentation = FormatStyle::NI_None;
+ verifyFormat("template <class T>\n"
+ "concept a_concept = X<>;\n"
+ "namespace B {\n"
+ "struct b_struct {};\n"
+ "} // namespace B\n",
+ Style);
}
TEST_F(FormatTest, NamespaceMacros) {