STL_MSFT created this revision.
STL_MSFT added reviewers: mclow.lists, EricWF.
STL_MSFT added a subscriber: cfe-commits.

Fix MSVC warning C4125 "decimal digit terminates octal escape sequence".

MSVC somewhat justifiably warns when it sees an octal escape immediately 
followed by a decimal digit, even if the octal escape used the maximum of 3 
octal digits.  Avoiding this warning while preserving the test's semantics (as 
viewed by the library) is easy - simply separate the string literal after the 
octal escape is finished.

http://reviews.llvm.org/D21096

Files:
  test/std/re/re.regex/re.regex.construct/awk_oct.pass.cpp
  test/std/re/re.submatch/re.submatch.op/compare.pass.cpp

Index: test/std/re/re.submatch/re.submatch.op/compare.pass.cpp
===================================================================
--- test/std/re/re.submatch/re.submatch.op/compare.pass.cpp
+++ test/std/re/re.submatch/re.submatch.op/compare.pass.cpp
@@ -283,6 +283,6 @@
     test(std::string("1234"), std::string("123"));
     test(std::wstring(L"123"), std::wstring(L"123"));
     test(std::wstring(L"1234"), std::wstring(L"123"));
-    test(std::string("123\00056", 6), std::string("123\00056", 6), false);
-    test(std::wstring(L"123\00056", 6), std::wstring(L"123\00056", 6), false);
+    test(std::string("123\000" "56", 6), std::string("123\000" "56", 6), 
false);
+    test(std::wstring(L"123\000" L"56", 6), std::wstring(L"123\000" L"56", 6), 
false);
 }
Index: test/std/re/re.regex/re.regex.construct/awk_oct.pass.cpp
===================================================================
--- test/std/re/re.regex/re.regex.construct/awk_oct.pass.cpp
+++ test/std/re/re.regex/re.regex.construct/awk_oct.pass.cpp
@@ -25,5 +25,5 @@
     assert(std::regex_match("\4", std::regex("\\4", awk)));
     assert(std::regex_match("\41", std::regex("\\41", awk)));
     assert(std::regex_match("\141", std::regex("\\141", awk)));
-    assert(std::regex_match("\1411", std::regex("\\1411", awk)));
+    assert(std::regex_match("\141" "1", std::regex("\\1411", awk)));
 }


Index: test/std/re/re.submatch/re.submatch.op/compare.pass.cpp
===================================================================
--- test/std/re/re.submatch/re.submatch.op/compare.pass.cpp
+++ test/std/re/re.submatch/re.submatch.op/compare.pass.cpp
@@ -283,6 +283,6 @@
     test(std::string("1234"), std::string("123"));
     test(std::wstring(L"123"), std::wstring(L"123"));
     test(std::wstring(L"1234"), std::wstring(L"123"));
-    test(std::string("123\00056", 6), std::string("123\00056", 6), false);
-    test(std::wstring(L"123\00056", 6), std::wstring(L"123\00056", 6), false);
+    test(std::string("123\000" "56", 6), std::string("123\000" "56", 6), false);
+    test(std::wstring(L"123\000" L"56", 6), std::wstring(L"123\000" L"56", 6), false);
 }
Index: test/std/re/re.regex/re.regex.construct/awk_oct.pass.cpp
===================================================================
--- test/std/re/re.regex/re.regex.construct/awk_oct.pass.cpp
+++ test/std/re/re.regex/re.regex.construct/awk_oct.pass.cpp
@@ -25,5 +25,5 @@
     assert(std::regex_match("\4", std::regex("\\4", awk)));
     assert(std::regex_match("\41", std::regex("\\41", awk)));
     assert(std::regex_match("\141", std::regex("\\141", awk)));
-    assert(std::regex_match("\1411", std::regex("\\1411", awk)));
+    assert(std::regex_match("\141" "1", std::regex("\\1411", awk)));
 }
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to