Fixes incorrect handling of the declaration context stack.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173250 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index fb5221e..114359d 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -1682,6 +1682,16 @@
TEST_F(FormatTest, FormatStarDependingOnContext) {
verifyFormat("void f(int *a);");
verifyFormat("void f() { f(fint * b); }");
+ verifyFormat("class A {\n void f(int *a);\n};");
+ verifyFormat("class A {\n int *a;\n};");
+ verifyFormat("namespace a {\n"
+ "namespace b {\n"
+ "class A {\n"
+ " void f() {}\n"
+ " int *a;\n"
+ "};\n"
+ "}\n"
+ "}");
}
TEST_F(FormatTest, SpecialTokensAtEndOfLine) {