summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2014-03-27 11:17:36 +0000
committerManuel Klimek <klimek@google.com>2014-03-27 11:17:36 +0000
commitf81e5c0e50424f65ed60ba8de9578f6edc79dd5d (patch)
treeb17b8744fb3605eaed23a560563fe3f8e688df68 /clang/unittests/Format/FormatTest.cpp
parent59a12198463bb13f1496205e496a2131462d3f88 (diff)
downloadbcm5719-llvm-f81e5c0e50424f65ed60ba8de9578f6edc79dd5d.tar.gz
bcm5719-llvm-f81e5c0e50424f65ed60ba8de9578f6edc79dd5d.zip
Fix bool expression special case.
Clang-format now correctly formats: some_type<a * b> v; template <bool a, bool b> typename enabled_if<a && b>::type f() {} llvm-svn: 204913
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index fa8ed3828d4..949167c8f56 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -4529,6 +4529,14 @@ TEST_F(FormatTest, UnderstandsUsesOfStarAndAmp) {
verifyFormat("delete *x;", PointerLeft);
verifyFormat("STATIC_ASSERT((a & b) == 0);");
verifyFormat("STATIC_ASSERT(0 == (a & b));");
+ verifyFormat("template <bool a, bool b> "
+ "typename t::if<x && y>::type f() {};");
+ verifyFormat("template <int *y> f() {};");
+ verifyFormat("vector<int *> v;");
+ verifyFormat("vector<int *const> v;");
+ verifyFormat("vector<int *const **const *> v;");
+ verifyFormat("vector<int *volatile> v;");
+ verifyFormat("vector<a * b> v;");
}
TEST_F(FormatTest, UnderstandsAttributes) {
OpenPOWER on IntegriCloud