aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2018-11-09 00:41:36 +0000
committerBill Wendling <isanbard@gmail.com>2018-11-09 00:41:36 +0000
commit8003edc9aa0160c777252b6ed8e96fc35f039bd4 (patch)
treed6a07c2e0b407f57baf6be744b81ef140079eb7d /clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
parent009cc9b7cadc81b50127f14ccdb8ff10fccc1f00 (diff)
downloadllvm-8003edc9aa0160c777252b6ed8e96fc35f039bd4.zip
llvm-8003edc9aa0160c777252b6ed8e96fc35f039bd4.tar.gz
llvm-8003edc9aa0160c777252b6ed8e96fc35f039bd4.tar.bz2
Compound literals, enums, et al require const expr
Summary: Compound literals, enums, file-scoped arrays, etc. require their initializers and size specifiers to be constant. Wrap the initializer expressions in a ConstantExpr so that we can easily check for this later on. Reviewers: rsmith, shafik Reviewed By: rsmith Subscribers: cfe-commits, jyknight, nickdesaulniers Differential Revision: https://reviews.llvm.org/D53921 llvm-svn: 346455
Diffstat (limited to 'clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp')
-rw-r--r--clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
index b40289fc..55f9a9a 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
+++ b/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
@@ -760,23 +760,23 @@ TEST(Matcher, Initializers) {
has(
designatedInitExpr(
designatorCountIs(2),
- has(floatLiteral(
+ hasDescendant(floatLiteral(
equals(1.0))),
- has(integerLiteral(
+ hasDescendant(integerLiteral(
equals(2))))),
has(
designatedInitExpr(
designatorCountIs(2),
- has(floatLiteral(
+ hasDescendant(floatLiteral(
equals(2.0))),
- has(integerLiteral(
+ hasDescendant(integerLiteral(
equals(2))))),
has(
designatedInitExpr(
designatorCountIs(2),
- has(floatLiteral(
+ hasDescendant(floatLiteral(
equals(1.0))),
- has(integerLiteral(
+ hasDescendant(integerLiteral(
equals(0)))))
)))));
}