[cfe-commits] r164944 - /cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp

Daniel Jasper djasper at google.com
Mon Oct 1 08:05:34 PDT 2012


Author: djasper
Date: Mon Oct  1 10:05:34 2012
New Revision: 164944

URL: http://llvm.org/viewvc/llvm-project?rev=164944&view=rev
Log:
Fix ASTMatchersTests in configurations where
"#include <initializer_list>" is unavailable for whatever reason.

Modified:
    cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp

Modified: cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp?rev=164944&r1=164943&r2=164944&view=diff
==============================================================================
--- cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp (original)
+++ cfe/trunk/unittests/ASTMatchers/ASTMatchersTest.cpp Mon Oct  1 10:05:34 2012
@@ -811,8 +811,8 @@
 }
 
 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(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()));
 }
 





More information about the cfe-commits mailing list