]> granicus.if.org Git - clang/commitdiff
Fix ASTMatchersTests in configurations where
authorDaniel Jasper <djasper@google.com>
Mon, 1 Oct 2012 15:05:34 +0000 (15:05 +0000)
committerDaniel Jasper <djasper@google.com>
Mon, 1 Oct 2012 15:05:34 +0000 (15:05 +0000)
"#include <initializer_list>" is unavailable for whatever reason.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164944 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/ASTMatchers/ASTMatchersTest.cpp

index 6698e4ecbc65403db49dc8445c87817cbb5e9634..d8f5511d6daddff13fcca000a2967c1f7b6c233d 100644 (file)
@@ -811,8 +811,8 @@ TEST(Matcher, Lambda) {
 }
 
 TEST(Matcher, ForRange) {
-  EXPECT_TRUE(matches("#include <initializer_list>\n"
-                      "void f() { for (auto &a : {1, 2, 3}); }",
+  EXPECT_TRUE(matches("int as[] = { 1, 2, 3 };"
+                      "void f() { for (auto &a : as); }",
                       forRangeStmt()));
   EXPECT_TRUE(notMatches("void f() { for (int i; i<5; ++i); }",
                          forRangeStmt()));
@@ -2006,8 +2006,8 @@ TEST(AstPolymorphicMatcherPMacro, Works) {
 TEST(For, FindsForLoops) {
   EXPECT_TRUE(matches("void f() { for(;;); }", forStmt()));
   EXPECT_TRUE(matches("void f() { if(true) for(;;); }", forStmt()));
-  EXPECT_TRUE(notMatches("#include <initializer_list>\n"
-                         "void f() { for (auto &a : {1, 2, 3}); }",
+  EXPECT_TRUE(notMatches("int as[] = { 1, 2, 3 };"
+                         "void f() { for (auto &a : as); }",
                          forStmt()));
 }