diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/lib/Format/UnwrappedLineParser.cpp @@ -1438,7 +1438,7 @@ break; case tok::kw_concept: parseConcept(); - break; + return; case tok::kw_requires: parseRequires(); break; diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -3548,6 +3548,14 @@ "} // namespace in\n" "} // namespace out", Style)); + + Style.NamespaceIndentation = FormatStyle::NI_None; + verifyFormat("template \n" + "concept a_concept = X<>;\n" + "namespace B {\n" + "struct b_struct {};\n" + "} // namespace B\n", + Style); } TEST_F(FormatTest, NamespaceMacros) {