diff options
author | Manuel Klimek <klimek@google.com> | 2013-01-23 11:03:04 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2013-01-23 11:03:04 +0000 |
commit | 390805731f9a8336bffa39bc237284570b12448b (patch) | |
tree | 5ab3c1f75939902cecba1684d1ce7a2a30bd0fd6 /clang/unittests/Format/FormatTest.cpp | |
parent | ffffbefa437a00ca44f0a925c0ff73ae38f1a936 (diff) | |
download | bcm5719-llvm-390805731f9a8336bffa39bc237284570b12448b.tar.gz bcm5719-llvm-390805731f9a8336bffa39bc237284570b12448b.zip |
Fixes incorrect handling of the declaration context stack.
llvm-svn: 173250
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index fb5221ee246..114359d04d1 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -1682,6 +1682,16 @@ TEST_F(FormatTest, BlockComments) { 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) { |