This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG960712ccc710: [clang-format] Fix wrong indentation of
namespace identifiers after a concept… (authored by curdeius).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D116008/new/
https://reviews.llvm.org/D116008
Files:
clang/lib/Format/UnwrappedLineParser.cpp
clang/unittests/Format/FormatTest.cpp
Index: clang/unittests/Format/FormatTest.cpp
===================================================================
--- clang/unittests/Format/FormatTest.cpp
+++ clang/unittests/Format/FormatTest.cpp
@@ -3548,6 +3548,14 @@
"} // 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) {
Index: clang/lib/Format/UnwrappedLineParser.cpp
===================================================================
--- clang/lib/Format/UnwrappedLineParser.cpp
+++ clang/lib/Format/UnwrappedLineParser.cpp
@@ -1438,7 +1438,7 @@
break;
case tok::kw_concept:
parseConcept();
- break;
+ return;
case tok::kw_requires:
parseRequires();
break;
Index: clang/unittests/Format/FormatTest.cpp
===================================================================
--- clang/unittests/Format/FormatTest.cpp
+++ clang/unittests/Format/FormatTest.cpp
@@ -3548,6 +3548,14 @@
"} // 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) {
Index: clang/lib/Format/UnwrappedLineParser.cpp
===================================================================
--- clang/lib/Format/UnwrappedLineParser.cpp
+++ clang/lib/Format/UnwrappedLineParser.cpp
@@ -1438,7 +1438,7 @@
break;
case tok::kw_concept:
parseConcept();
- break;
+ return;
case tok::kw_requires:
parseRequires();
break;
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits