aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbutl/regex.cxx8
-rw-r--r--tests/base64/driver.cxx2
-rw-r--r--tests/regex/driver.cxx5
-rw-r--r--tests/timestamp/driver.cxx2
4 files changed, 13 insertions, 4 deletions
diff --git a/libbutl/regex.cxx b/libbutl/regex.cxx
index 6159d54..e4fd009 100644
--- a/libbutl/regex.cxx
+++ b/libbutl/regex.cxx
@@ -15,7 +15,7 @@
#include <ostream>
#include <sstream>
#include <stdexcept> // runtime_error
-#if defined(_MSC_VER) && _MSC_VER <= 1911
+#if defined(_MSC_VER) && _MSC_VER <= 1912
# include <cstring> // strstr()
#endif
#endif
@@ -52,7 +52,11 @@ namespace std
{
const char* d (e.what ());
-#if defined(_MSC_VER) && _MSC_VER <= 1911
+#if defined(_MSC_VER) && _MSC_VER <= 1912
+ // Note: run the regex test like this to check new VC version:
+ //
+ // ./driver.exe a '{' b
+ //
const char* rd (strstr (d, "): "));
if (rd != nullptr)
d = rd + 3;
diff --git a/tests/base64/driver.cxx b/tests/base64/driver.cxx
index fb65a49..195eaf0 100644
--- a/tests/base64/driver.cxx
+++ b/tests/base64/driver.cxx
@@ -40,7 +40,7 @@ encode (const string& i, const string& o)
// VC15 seekg() doesn't clear eofbit.
//
-#if defined(_MSC_VER) && _MSC_VER <= 1911
+#if defined(_MSC_VER) && _MSC_VER <= 1912
is.clear ();
#endif
diff --git a/tests/regex/driver.cxx b/tests/regex/driver.cxx
index 3f6129a..5e96f06 100644
--- a/tests/regex/driver.cxx
+++ b/tests/regex/driver.cxx
@@ -74,6 +74,11 @@ try
return r.second ? 0 : 1;
}
+catch (const regex_error& e)
+{
+ cerr << "invalid regex" << e << endl; // Print sanitized.
+ return 2;
+}
catch (const exception& e)
{
cerr << e << endl;
diff --git a/tests/timestamp/driver.cxx b/tests/timestamp/driver.cxx
index ec4c49d..cdaaaec 100644
--- a/tests/timestamp/driver.cxx
+++ b/tests/timestamp/driver.cxx
@@ -133,7 +133,7 @@ main ()
// "Apr 19:31:10 2016" for the format "%b %d %H:%M:%S %Y" as if the input were
// "Apr 19 00:31:10 2016".
//
-#if !defined(_MSC_VER) || _MSC_VER > 1911
+#if !defined(_MSC_VER) || _MSC_VER > 1912
assert (fail ("Apr 19:31:10 2016", "%b %d %H:%M:%S %Y"));
assert (fail (":31 2016", "%H:%M %Y"));
#endif