[PATCH] D116008: [clang-format] Fix wrong indentation of namespace identifiers after a concept declaration.
Marek Kurdej via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Dec 19 13:51:05 PST 2021
curdeius updated this revision to Diff 395355.
curdeius added a comment.
Undo unrelated changes.
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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116008.395355.patch
Type: text/x-patch
Size: 1040 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211219/c9769f37/attachment-0001.bin>
More information about the cfe-commits
mailing list