summaryrefslogtreecommitdiff
path: root/test/std/re/re.traits/lookup_classname.pass.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-07-23 20:47:26 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-07-23 20:47:26 +0000
commit51072bd6bf79ef2bc6a922079bff57c31c1effbc (patch)
tree91a2effbc9e6f80bdbbf9eb70e06c51ad0867ea0 /test/std/re/re.traits/lookup_classname.pass.cpp
parentbb5e33f003797b67974a8893f7f2930fc51b8210 (diff)
Notes
Diffstat (limited to 'test/std/re/re.traits/lookup_classname.pass.cpp')
-rw-r--r--test/std/re/re.traits/lookup_classname.pass.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/std/re/re.traits/lookup_classname.pass.cpp b/test/std/re/re.traits/lookup_classname.pass.cpp
index 0b1b18eb5077..4f7cf61ebf99 100644
--- a/test/std/re/re.traits/lookup_classname.pass.cpp
+++ b/test/std/re/re.traits/lookup_classname.pass.cpp
@@ -18,6 +18,7 @@
#include <regex>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
template <class char_type>
@@ -33,6 +34,19 @@ test(const char_type* A,
int main()
{
+// if __regex_word is not distinct from all the classes, bad things happen
+// See https://llvm.org/bugs/show_bug.cgi?id=26476 for an example.
+ assert((std::ctype_base::space & std::regex_traits<char>::__regex_word) == 0);
+ assert((std::ctype_base::print & std::regex_traits<char>::__regex_word) == 0);
+ assert((std::ctype_base::cntrl & std::regex_traits<char>::__regex_word) == 0);
+ assert((std::ctype_base::upper & std::regex_traits<char>::__regex_word) == 0);
+ assert((std::ctype_base::lower & std::regex_traits<char>::__regex_word) == 0);
+ assert((std::ctype_base::alpha & std::regex_traits<char>::__regex_word) == 0);
+ assert((std::ctype_base::digit & std::regex_traits<char>::__regex_word) == 0);
+ assert((std::ctype_base::punct & std::regex_traits<char>::__regex_word) == 0);
+ assert((std::ctype_base::xdigit & std::regex_traits<char>::__regex_word) == 0);
+ assert((std::ctype_base::blank & std::regex_traits<char>::__regex_word) == 0);
+
test("d", std::ctype_base::digit);
test("D", std::ctype_base::digit);
test("d", std::ctype_base::digit, true);