diff options
| author | Daniel Jasper <djasper@google.com> | 2013-07-11 14:33:06 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2013-07-11 14:33:06 +0000 |
| commit | a3501d4b81c170d3b0fc7645a6f5357c24e517e7 (patch) | |
| tree | e6276d2d47ae17385a1f805678ecbd63a9db480d /clang/unittests/Format/FormatTest.cpp | |
| parent | 889865fb699aa9d9cfd50d97239fd3fcf21f2f30 (diff) | |
| download | bcm5719-llvm-a3501d4b81c170d3b0fc7645a6f5357c24e517e7.tar.gz bcm5719-llvm-a3501d4b81c170d3b0fc7645a6f5357c24e517e7.zip | |
Improve detection of trailing return types.
Trailing return types can only occur in declaration contexts.
Before:
void f() { auto a = b -> c(); }
After:
void f() { auto a = b->c(); }
llvm-svn: 186087
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
| -rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 42cd89cc8b7..37ac1a264a3 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -2476,6 +2476,9 @@ TEST_F(FormatTest, TrailingReturnType) { verifyFormat("template <size_t Order, typename T>\n" "auto load_img(const std::string &filename)\n" " -> alias::tensor<Order, T, mem::tag::cpu> {}"); + + // Not trailing return types. + verifyFormat("void f() { auto a = b->c(); }"); } TEST_F(FormatTest, BreaksFunctionDeclarationsWithTrailingTokens) { |

