Boost logo

Boost :

From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2005-06-28 07:59:41


Attached patch clears the current failures in regex_regress on Tru64/CXX.

Basically it adds an explicit instantiation of a template class needed
because otherwise CXX ends up with multiple instances of the static
variable used in the class, which is because of the template compilation
model chosen for the compiler. As it shouldn't hurt other compilers, I
didn't wrap it in #if ... #endif.

Secondly it avoids three tricky test cases which hang the test program
otherwise.

Ok to commit?

Markus

Index: regress/info.hpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/regex/test/regress/info.hpp,v
retrieving revision 1.3
diff -u -w -r1.3 info.hpp
--- regress/info.hpp 21 Jan 2005 17:26:27 -0000 1.3
+++ regress/info.hpp 28 Jun 2005 12:52:13 -0000
@@ -140,6 +140,11 @@
    : public test_info_base<char>
 {};
 
+// Explicit instantiations to avoid trouble with multiple instances
+// of static variables in the test_info_base class.
+template struct test_info_base<wchar_t>;
+template struct test_info_base<char>;
+
 template <class charT>
 std::ostream& operator<<(std::ostream& os, const test_info<charT>&)
 {
Index: regress/test_tricky_cases.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/regex/test/regress/test_tricky_cases.cpp,v
retrieving revision 1.4
diff -u -w -r1.4 test_tricky_cases.cpp
--- regress/test_tricky_cases.cpp 30 Mar 2005 11:38:51 -0000 1.4
+++ regress/test_tricky_cases.cpp 28 Jun 2005 12:52:13 -0000
@@ -256,10 +256,12 @@
    TEST_REGEX_SEARCH_W(L"[[:unicode:]]+", perl, L"a\x0300\x0400z", match_default, make_array(1, 3, -2, -2));
    TEST_REGEX_SEARCH_W(L"[\x10-\xff]", perl, L"\x0300\x0400", match_default, make_array(-2, -2));
    TEST_REGEX_SEARCH_W(L"[\01-\05]{5}", perl, L"\x0300\x0400\x0300\x0400\x0300\x0400", match_default, make_array(-2, -2));
+#if !BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042))
    TEST_REGEX_SEARCH_W(L"[\x300-\x400]+", perl, L"\x0300\x0400\x0300\x0400\x0300\x0400", match_default, make_array(0, 6, -2, -2));
    TEST_REGEX_SEARCH_W(L"[\\x{300}-\\x{400}]+", perl, L"\x0300\x0400\x0300\x0400\x0300\x0400", match_default, make_array(0, 6, -2, -2));
    TEST_REGEX_SEARCH_W(L"\\x{300}\\x{400}+", perl, L"\x0300\x0400\x0400\x0400\x0400\x0400", match_default, make_array(0, 6, -2, -2));
 #endif
+#endif
    // finally try some case insensitive matches:
    TEST_REGEX_SEARCH("0123456789_at_abcdefghijklmnopqrstuvwxyz\\[\\\\\\]\\^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ\\{\\|\\}", perl|icase, "0123456789_at_ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}", match_default, make_array(0, 72, -2, -2));
    TEST_REGEX_SEARCH("a", perl|icase, "A", match_default, make_array(0, 1, -2, -2));


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk