summaryrefslogtreecommitdiff
path: root/unittests/ASTMatchers/ASTMatchersTest.cpp
diff options
context:
space:
mode:
authorMatthias Gehre <M.Gehre@gmx.de>2016-04-12 05:43:18 +0000
committerMatthias Gehre <M.Gehre@gmx.de>2016-04-12 05:43:18 +0000
commit686c82b22c66974f48de6ca944c4eedfa99cfb14 (patch)
tree8bbaa5e22492573e4880821a11ed3934ade913b4 /unittests/ASTMatchers/ASTMatchersTest.cpp
parentf27cb29e4198fcf01547c845f53e6398cc77ecf9 (diff)
downloadclang-686c82b22c66974f48de6ca944c4eedfa99cfb14.tar.gz
[ASTMatchers]: fix crash in hasReturnValue
Summary: The crash was reproduced by the included test case. It was initially found through a crash of clang-tidy's misc-misplaced-widening-cast check. Reviewers: klimek, alexfh Subscribers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D18991 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266043 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/ASTMatchers/ASTMatchersTest.cpp')
-rw-r--r--unittests/ASTMatchers/ASTMatchersTest.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/unittests/ASTMatchers/ASTMatchersTest.cpp b/unittests/ASTMatchers/ASTMatchersTest.cpp
index a346179357..e4b6bb1703 100644
--- a/unittests/ASTMatchers/ASTMatchersTest.cpp
+++ b/unittests/ASTMatchers/ASTMatchersTest.cpp
@@ -5500,6 +5500,7 @@ TEST(StatementMatcher, HasReturnValue) {
StatementMatcher RetVal = returnStmt(hasReturnValue(binaryOperator()));
EXPECT_TRUE(matches("int F() { int a, b; return a + b; }", RetVal));
EXPECT_FALSE(matches("int F() { int a; return a; }", RetVal));
+ EXPECT_FALSE(matches("void F() { return; }", RetVal));
}
} // end namespace ast_matchers