summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-05-06 14:53:50 +0000
committerDaniel Jasper <djasper@google.com>2015-05-06 14:53:50 +0000
commit112b50e6b627f4780656a4f62f446848e46197b9 (patch)
treeb7494b63bece885c1f77b09dc1b7c5af3a1e318d /clang/unittests/Format/FormatTest.cpp
parente92bf6f14178e24c2be4812ddb772b01995f9c79 (diff)
downloadbcm5719-llvm-112b50e6b627f4780656a4f62f446848e46197b9.tar.gz
bcm5719-llvm-112b50e6b627f4780656a4f62f446848e46197b9.zip
clang-format: Allow ternary expressions inside template parameters if
the template parameters aren't inside an expression context. This fixes llvm.org/PR23270. llvm-svn: 236603
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index cb1f7bd539f..b4c8c26664a 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -5144,6 +5144,8 @@ TEST_F(FormatTest, UnderstandsTemplateParameters) {
verifyFormat("f<int>();");
verifyFormat("template <typename T> void f() {}");
verifyFormat("struct A<std::enable_if<sizeof(T2) < sizeof(int32)>::type>;");
+ verifyFormat("struct A<std::enable_if<sizeof(T2) ? sizeof(int32) : "
+ "sizeof(char)>::type>;");
// Not template parameters.
verifyFormat("return a < b && c > d;");
OpenPOWER on IntegriCloud