aboutsummaryrefslogtreecommitdiff
path: root/include/clang/ASTMatchers
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-05-06 03:47:15 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-05-06 03:47:15 +0000
commit5b0a110410710c5e5b3a197edced3676c92b6e89 (patch)
tree8a3994ce841efa3aa2dfb291957cdd316053d3a1 /include/clang/ASTMatchers
parentf14f7e2753fb69cec95009f4f3b2e3eab14e4f10 (diff)
[c++20] Implement P1009R2: allow omitting the array bound in an array
new expression. This was voted into C++20 as a defect report resolution, so we retroactively apply it to all prior language modes (though it can never actually be used before C++11 mode). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360006 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/ASTMatchers')
-rw-r--r--include/clang/ASTMatchers/ASTMatchers.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/clang/ASTMatchers/ASTMatchers.h b/include/clang/ASTMatchers/ASTMatchers.h
index 57dff7993d..d973b48a17 100644
--- a/include/clang/ASTMatchers/ASTMatchers.h
+++ b/include/clang/ASTMatchers/ASTMatchers.h
@@ -6413,8 +6413,8 @@ AST_MATCHER(CXXNewExpr, isArray) {
/// cxxNewExpr(hasArraySize(intgerLiteral(equals(10))))
/// matches the expression 'new MyClass[10]'.
AST_MATCHER_P(CXXNewExpr, hasArraySize, internal::Matcher<Expr>, InnerMatcher) {
- return Node.isArray() &&
- InnerMatcher.matches(*Node.getArraySize(), Finder, Builder);
+ return Node.isArray() && *Node.getArraySize() &&
+ InnerMatcher.matches(**Node.getArraySize(), Finder, Builder);
}
/// Matches a class declaration that is defined.