diff options
author | Matthias Gehre <M.Gehre@gmx.de> | 2016-04-12 05:43:18 +0000 |
---|---|---|
committer | Matthias Gehre <M.Gehre@gmx.de> | 2016-04-12 05:43:18 +0000 |
commit | c27d8d8fd801e141d4c3ead53627f0579384bdb8 (patch) | |
tree | 0f731e3ff210505d6e85d7499ae0d7c17be3173b /clang/unittests/ASTMatchers/ASTMatchersTest.cpp | |
parent | dd4799c28ed99980991241d0c517fe7076c06d5b (diff) | |
download | bcm5719-llvm-c27d8d8fd801e141d4c3ead53627f0579384bdb8.tar.gz bcm5719-llvm-c27d8d8fd801e141d4c3ead53627f0579384bdb8.zip |
[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
llvm-svn: 266043
Diffstat (limited to 'clang/unittests/ASTMatchers/ASTMatchersTest.cpp')
-rw-r--r-- | clang/unittests/ASTMatchers/ASTMatchersTest.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp index a3461793579..e4b6bb17033 100644 --- a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp +++ b/clang/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 |