summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Format/UnwrappedLineParser.cpp1
-rw-r--r--clang/unittests/Format/FormatTestJS.cpp3
2 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp
index 7f5df7dfba7..2762979b6bd 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -854,6 +854,7 @@ void UnwrappedLineParser::parseStructuralElement() {
Style.Language == FormatStyle::LK_Java) &&
FormatTok->is(Keywords.kw_interface)) {
parseRecord();
+ addUnwrappedLine();
break;
}
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index e01637bfad4..0f9f38240a3 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -665,7 +665,8 @@ TEST_F(FormatTestJS, ClassDeclarations) {
TEST_F(FormatTestJS, InterfaceDeclarations) {
verifyFormat("interface I {\n"
" x: string;\n"
- "}");
+ "}\n"
+ "var y;");
}
TEST_F(FormatTestJS, MetadataAnnotations) {
OpenPOWER on IntegriCloud