This revision was not accepted when it landed; it landed in state "Needs 
Review".
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb6073ee9ae84: Enable the test for hasArraySize() AST matcher 
in all language modes (authored by gribozavr).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83966/new/


  https://reviews.llvm.org/D83966

Files:
  clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp



Index: clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
===================================================================
--- clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
+++ clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
@@ -3219,13 +3219,13 @@
 }
 
 TEST_P(ASTMatchersTest, HasArraySize) {
-  if (GetParam().Language != Lang_CXX03) {
-    // FIXME: Fix this test to work in all C++ language modes.
+  if (!GetParam().isCXX()) {
     return;
   }
 
   EXPECT_TRUE(matches("struct MyClass {}; MyClass *p1 = new MyClass[10];",
-                      cxxNewExpr(hasArraySize(integerLiteral(equals(10))))));
+                      cxxNewExpr(hasArraySize(
+                          
ignoringParenImpCasts(integerLiteral(equals(10)))))));
 }
 
 TEST_P(ASTMatchersTest, HasDefinition_MatchesStructDefinition) {


Index: clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
===================================================================
--- clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
+++ clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
@@ -3219,13 +3219,13 @@
 }
 
 TEST_P(ASTMatchersTest, HasArraySize) {
-  if (GetParam().Language != Lang_CXX03) {
-    // FIXME: Fix this test to work in all C++ language modes.
+  if (!GetParam().isCXX()) {
     return;
   }
 
   EXPECT_TRUE(matches("struct MyClass {}; MyClass *p1 = new MyClass[10];",
-                      cxxNewExpr(hasArraySize(integerLiteral(equals(10))))));
+                      cxxNewExpr(hasArraySize(
+                          ignoringParenImpCasts(integerLiteral(equals(10)))))));
 }
 
 TEST_P(ASTMatchersTest, HasDefinition_MatchesStructDefinition) {
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to