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 | 836b58f564e07e806d3d0b41a193fde0921013c7 (patch) | |
tree | ea96bbe81e8b669315cafe1e22d1238bc1bf87f4 /unittests/Format/FormatTest.cpp | |
parent | 092a2c7373c02d1653bea1feb1ada05363b02bc2 (diff) |
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
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index fb5221ee24..114359d04d 100644 --- a/unittests/Format/FormatTest.cpp +++ b/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) { |