[cfe-commits] [libcxx] r111024 - in /libcxx/trunk: include/ test/re/re.alg/re.alg.search/ test/re/re.regex/re.regex.assign/ test/re/re.regex/re.regex.construct/ test/re/re.regex/re.regex.locale/ test/re/re.regex/re.regex.nonmemb/ test/re/re.regex/re.regex.nonmemb/re.regex.nmswap/ test/re/re.regex/re.regex.operations/ test/re/re.regex/re.regex.swap/ test/re/re.traits/

Howard Hinnant hhinnant at apple.com
Fri Aug 13 11:11:23 PDT 2010


Author: hhinnant
Date: Fri Aug 13 13:11:23 2010
New Revision: 111024

URL: http://llvm.org/viewvc/llvm-project?rev=111024&view=rev
Log:
Everything under [re.regex]

Added:
    libcxx/trunk/test/re/re.regex/re.regex.assign/assign.il.pass.cpp
    libcxx/trunk/test/re/re.regex/re.regex.assign/assign.pass.cpp
    libcxx/trunk/test/re/re.regex/re.regex.assign/assign_iter_iter_flag.pass.cpp
    libcxx/trunk/test/re/re.regex/re.regex.assign/assign_ptr_flag.pass.cpp
    libcxx/trunk/test/re/re.regex/re.regex.assign/assign_ptr_size_flag.pass.cpp
    libcxx/trunk/test/re/re.regex/re.regex.assign/assign_string_flag.pass.cpp
    libcxx/trunk/test/re/re.regex/re.regex.assign/copy.pass.cpp
    libcxx/trunk/test/re/re.regex/re.regex.assign/il.pass.cpp
    libcxx/trunk/test/re/re.regex/re.regex.assign/ptr.pass.cpp
    libcxx/trunk/test/re/re.regex/re.regex.assign/string.pass.cpp
    libcxx/trunk/test/re/re.regex/re.regex.construct/copy.pass.cpp
    libcxx/trunk/test/re/re.regex/re.regex.locale/imbue.pass.cpp
    libcxx/trunk/test/re/re.regex/re.regex.nonmemb/nothing_to_do.pass.cpp
    libcxx/trunk/test/re/re.regex/re.regex.nonmemb/re.regex.nmswap/swap.pass.cpp
    libcxx/trunk/test/re/re.regex/re.regex.operations/tested_elsewhere.pass.cpp
    libcxx/trunk/test/re/re.regex/re.regex.swap/swap.pass.cpp
Modified:
    libcxx/trunk/include/regex
    libcxx/trunk/test/re/re.alg/re.alg.search/ecma.pass.cpp
    libcxx/trunk/test/re/re.alg/re.alg.search/egrep.pass.cpp
    libcxx/trunk/test/re/re.alg/re.alg.search/grep.pass.cpp
    libcxx/trunk/test/re/re.regex/re.regex.construct/ptr.pass.cpp
    libcxx/trunk/test/re/re.regex/re.regex.construct/ptr_flg.pass.cpp
    libcxx/trunk/test/re/re.regex/re.regex.construct/string_flg.pass.cpp
    libcxx/trunk/test/re/re.traits/lookup_collatename.pass.cpp
    libcxx/trunk/test/re/re.traits/transform_primary.pass.cpp
    libcxx/trunk/test/re/re.traits/value.pass.cpp

Modified: libcxx/trunk/include/regex
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/regex?rev=111024&r1=111023&r2=111024&view=diff
==============================================================================
--- libcxx/trunk/include/regex (original)
+++ libcxx/trunk/include/regex Fri Aug 13 13:11:23 2010
@@ -2529,41 +2529,88 @@
           __end_(0), __left_anchor_(false)
         {__parse(__il.begin(), __il.end());}
 
-    ~basic_regex();
+//    ~basic_regex() = default;
 
 //     basic_regex& operator=(const basic_regex&) = default;
 //     basic_regex& operator=(basic_regex&&) = default;
-    basic_regex& operator=(const value_type* __p);
-    basic_regex& operator=(initializer_list<value_type> __il);
+    basic_regex& operator=(const value_type* __p)
+        {return assign(__p);}
+    basic_regex& operator=(initializer_list<value_type> __il)
+        {return assign(__il);}
     template <class _ST, class _SA>
-        basic_regex& operator=(const basic_string<value_type, _ST, _SA>& __p);
+        basic_regex& operator=(const basic_string<value_type, _ST, _SA>& __p)
+        {return assign(__p);}
 
     // assign:
-    basic_regex& assign(const basic_regex& __that);
-#ifdef _LIBCPP_MOVE
-    basic_regex& assign(basic_regex&& __that);
-#endif
-    basic_regex& assign(const value_type* __p, flag_type __f = regex_constants::ECMAScript);
-    basic_regex& assign(const value_type* __p, size_t __len, flag_type __f);
+    basic_regex& assign(const basic_regex& __that)
+        {return *this = __that;}
+    basic_regex& assign(const value_type* __p, flag_type __f = regex_constants::ECMAScript)
+        {return assign(__p, __p + __traits_.length(__p), __f);}
+    basic_regex& assign(const value_type* __p, size_t __len, flag_type __f)
+        {return assign(__p, __p + __len, __f);}
     template <class _ST, class _SA>
         basic_regex& assign(const basic_string<value_type, _ST, _SA>& __s,
-                            flag_type __f = regex_constants::ECMAScript);
+                            flag_type __f = regex_constants::ECMAScript)
+            {return assign(__s.begin(), __s.end(), __f);}
+
     template <class _InputIterator>
-        basic_regex& assign(_InputIterator __first, _InputIterator __last,
-                            flag_type __f = regex_constants::ECMAScript);
+        typename enable_if
+        <
+             __is_input_iterator  <_InputIterator>::value &&
+            !__is_forward_iterator<_InputIterator>::value,
+            basic_regex&
+        >::type
+        assign(_InputIterator __first, _InputIterator __last,
+                            flag_type __f = regex_constants::ECMAScript)
+        {
+            basic_string<_CharT> __t(__first, __last);
+            return assign(__t.begin(), __t.end(), __f);
+        }
+
+private:
+    void __member_init(flag_type __f)
+    {
+        __flags_ = __f;
+        __marked_count_ = 0;
+        __loop_count_ = 0;
+        __open_count_ = 0;
+        __end_ = nullptr;
+        __left_anchor_ = false;
+    }
+public:
+
+    template <class _ForwardIterator>
+        typename enable_if
+        <
+            __is_forward_iterator<_ForwardIterator>::value,
+            basic_regex&
+        >::type
+        assign(_ForwardIterator __first, _ForwardIterator __last,
+                            flag_type __f = regex_constants::ECMAScript)
+        {
+            __member_init(__f);
+            __parse(__first, __last);
+        }
+
     basic_regex& assign(initializer_list<value_type> __il,
-                        flag_type = regex_constants::ECMAScript);
+                        flag_type __f = regex_constants::ECMAScript)
+        {return assign(__il.begin(), __il.end(), __f);}
 
     // const operations:
     unsigned mark_count() const {return __marked_count_;}
     flag_type flags() const {return __flags_;}
 
     // locale:
-    locale_type imbue(locale_type __loc) {return __traits_.imbue(__loc);}
+    locale_type imbue(locale_type __loc)
+    {
+        __member_init(ECMAScript);
+        __start_.reset();
+        return __traits_.imbue(__loc);
+    }
     locale_type getloc() const {return __traits_.getloc();}
 
     // swap:
-    void swap(basic_regex&);
+    void swap(basic_regex& __r);
 
 private:
     unsigned __loop_count() const {return __loop_count_;}
@@ -2810,8 +2857,26 @@
 };
 
 template <class _CharT, class _Traits>
-basic_regex<_CharT, _Traits>::~basic_regex()
+void
+basic_regex<_CharT, _Traits>::swap(basic_regex& __r)
+{
+    using _STD::swap;
+    swap(__traits_, __r.__traits_);
+    swap(__flags_, __r.__flags_);
+    swap(__marked_count_, __r.__marked_count_);
+    swap(__loop_count_, __r.__loop_count_);
+    swap(__open_count_, __r.__open_count_);
+    swap(__start_, __r.__start_);
+    swap(__end_, __r.__end_);
+    swap(__left_anchor_, __r.__left_anchor_);
+}
+
+template <class _CharT, class _Traits>
+inline _LIBCPP_INLINE_VISIBILITY
+void
+swap(basic_regex<_CharT, _Traits>& __x, basic_regex<_CharT, _Traits>& __y)
 {
+    return __x.swap(__y);
 }
 
 // __lookahead

Modified: libcxx/trunk/test/re/re.alg/re.alg.search/ecma.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/re/re.alg/re.alg.search/ecma.pass.cpp?rev=111024&r1=111023&r2=111024&view=diff
==============================================================================
--- libcxx/trunk/test/re/re.alg/re.alg.search/ecma.pass.cpp (original)
+++ libcxx/trunk/test/re/re.alg/re.alg.search/ecma.pass.cpp Fri Aug 13 13:11:23 2010
@@ -16,8 +16,6 @@
 //                  const basic_regex<charT, traits>& e,
 //                  regex_constants::match_flag_type flags = regex_constants::match_default);
 
-#include <iostream>
-
 #include <regex>
 #include <cassert>
 

Modified: libcxx/trunk/test/re/re.alg/re.alg.search/egrep.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/re/re.alg/re.alg.search/egrep.pass.cpp?rev=111024&r1=111023&r2=111024&view=diff
==============================================================================
--- libcxx/trunk/test/re/re.alg/re.alg.search/egrep.pass.cpp (original)
+++ libcxx/trunk/test/re/re.alg/re.alg.search/egrep.pass.cpp Fri Aug 13 13:11:23 2010
@@ -16,8 +16,6 @@
 //                  const basic_regex<charT, traits>& e,
 //                  regex_constants::match_flag_type flags = regex_constants::match_default);
 
-#include <iostream>
-
 #include <regex>
 #include <cassert>
 

Modified: libcxx/trunk/test/re/re.alg/re.alg.search/grep.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/re/re.alg/re.alg.search/grep.pass.cpp?rev=111024&r1=111023&r2=111024&view=diff
==============================================================================
--- libcxx/trunk/test/re/re.alg/re.alg.search/grep.pass.cpp (original)
+++ libcxx/trunk/test/re/re.alg/re.alg.search/grep.pass.cpp Fri Aug 13 13:11:23 2010
@@ -16,8 +16,6 @@
 //                  const basic_regex<charT, traits>& e,
 //                  regex_constants::match_flag_type flags = regex_constants::match_default);
 
-#include <iostream>
-
 #include <regex>
 #include <cassert>
 

Added: libcxx/trunk/test/re/re.regex/re.regex.assign/assign.il.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/re/re.regex/re.regex.assign/assign.il.pass.cpp?rev=111024&view=auto
==============================================================================
--- libcxx/trunk/test/re/re.regex/re.regex.assign/assign.il.pass.cpp (added)
+++ libcxx/trunk/test/re/re.regex/re.regex.assign/assign.il.pass.cpp Fri Aug 13 13:11:23 2010
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <regex>
+
+// template <class charT, class traits = regex_traits<charT>> class basic_regex;
+
+// basic_regex&
+//    assign(initializer_list<charT> il,
+//           flag_type f = regex_constants::ECMAScript);
+
+#include <regex>
+#include <cassert>
+
+int main()
+{
+#ifdef _LIBCPP_MOVE
+    std::regex r2;
+    r2.assign({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'});
+    assert(r2.flags() == std::regex::ECMAScript);
+    assert(r2.mark_count() == 2);
+
+    r2.assign({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'}, std::regex::extended);
+    assert(r2.flags() == std::regex::extended);
+    assert(r2.mark_count() == 2);
+#endif
+}

Added: libcxx/trunk/test/re/re.regex/re.regex.assign/assign.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/re/re.regex/re.regex.assign/assign.pass.cpp?rev=111024&view=auto
==============================================================================
--- libcxx/trunk/test/re/re.regex/re.regex.assign/assign.pass.cpp (added)
+++ libcxx/trunk/test/re/re.regex/re.regex.assign/assign.pass.cpp Fri Aug 13 13:11:23 2010
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <regex>
+
+// template <class charT, class traits = regex_traits<charT>> class basic_regex;
+
+// basic_regex& assign(const basic_regex& that);
+
+#include <regex>
+#include <cassert>
+
+int main()
+{
+    std::regex r1("(a([bc]))");
+    std::regex r2;
+    r2.assign(r1);
+    assert(r2.flags() == std::regex::ECMAScript);
+    assert(r2.mark_count() == 2);
+}

Added: libcxx/trunk/test/re/re.regex/re.regex.assign/assign_iter_iter_flag.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/re/re.regex/re.regex.assign/assign_iter_iter_flag.pass.cpp?rev=111024&view=auto
==============================================================================
--- libcxx/trunk/test/re/re.regex/re.regex.assign/assign_iter_iter_flag.pass.cpp (added)
+++ libcxx/trunk/test/re/re.regex/re.regex.assign/assign_iter_iter_flag.pass.cpp Fri Aug 13 13:11:23 2010
@@ -0,0 +1,46 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <regex>
+
+// template <class charT, class traits = regex_traits<charT>> class basic_regex;
+
+// template <class InputIterator>
+//    basic_regex&
+//    assign(InputIterator first, InputIterator last,
+//           flag_type f = regex_constants::ECMAScript);
+
+#include <regex>
+#include <cassert>
+
+#include "../../iterators.h"
+
+int main()
+{
+    typedef input_iterator<std::string::const_iterator> I;
+    typedef forward_iterator<std::string::const_iterator> F;
+    std::string s4("(a([bc]))");
+    std::regex r2;
+
+    r2.assign(I(s4.begin()), I(s4.end()));
+    assert(r2.flags() == std::regex::ECMAScript);
+    assert(r2.mark_count() == 2);
+
+    r2.assign(I(s4.begin()), I(s4.end()), std::regex::extended);
+    assert(r2.flags() == std::regex::extended);
+    assert(r2.mark_count() == 2);
+
+    r2.assign(F(s4.begin()), F(s4.end()));
+    assert(r2.flags() == std::regex::ECMAScript);
+    assert(r2.mark_count() == 2);
+
+    r2.assign(F(s4.begin()), F(s4.end()), std::regex::extended);
+    assert(r2.flags() == std::regex::extended);
+    assert(r2.mark_count() == 2);
+}

Added: libcxx/trunk/test/re/re.regex/re.regex.assign/assign_ptr_flag.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/re/re.regex/re.regex.assign/assign_ptr_flag.pass.cpp?rev=111024&view=auto
==============================================================================
--- libcxx/trunk/test/re/re.regex/re.regex.assign/assign_ptr_flag.pass.cpp (added)
+++ libcxx/trunk/test/re/re.regex/re.regex.assign/assign_ptr_flag.pass.cpp Fri Aug 13 13:11:23 2010
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <regex>
+
+// template <class charT, class traits = regex_traits<charT>> class basic_regex;
+
+// basic_regex& assign(const charT* ptr, flag_type f = regex_constants::ECMAScript);
+
+#include <regex>
+#include <cassert>
+
+int main()
+{
+    std::regex r2;
+    r2.assign("(a([bc]))");
+    assert(r2.flags() == std::regex::ECMAScript);
+    assert(r2.mark_count() == 2);
+
+    r2.assign("(a([bc]))", std::regex::extended);
+    assert(r2.flags() == std::regex::extended);
+    assert(r2.mark_count() == 2);
+}

Added: libcxx/trunk/test/re/re.regex/re.regex.assign/assign_ptr_size_flag.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/re/re.regex/re.regex.assign/assign_ptr_size_flag.pass.cpp?rev=111024&view=auto
==============================================================================
--- libcxx/trunk/test/re/re.regex/re.regex.assign/assign_ptr_size_flag.pass.cpp (added)
+++ libcxx/trunk/test/re/re.regex/re.regex.assign/assign_ptr_size_flag.pass.cpp Fri Aug 13 13:11:23 2010
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <regex>
+
+// template <class charT, class traits = regex_traits<charT>> class basic_regex;
+
+// basic_regex& assign(const charT* ptr, size_t len, flag_type f);
+
+#include <regex>
+#include <cassert>
+
+int main()
+{
+    std::regex r2;
+    r2.assign("(a([bc]))", 9, std::regex::extended);
+    assert(r2.flags() == std::regex::extended);
+    assert(r2.mark_count() == 2);
+}

Added: libcxx/trunk/test/re/re.regex/re.regex.assign/assign_string_flag.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/re/re.regex/re.regex.assign/assign_string_flag.pass.cpp?rev=111024&view=auto
==============================================================================
--- libcxx/trunk/test/re/re.regex/re.regex.assign/assign_string_flag.pass.cpp (added)
+++ libcxx/trunk/test/re/re.regex/re.regex.assign/assign_string_flag.pass.cpp Fri Aug 13 13:11:23 2010
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <regex>
+
+// template <class charT, class traits = regex_traits<charT>> class basic_regex;
+
+// template <class string_traits, class A>
+//   basic_regex& assign(const basic_string<charT, string_traits, A>& s,
+//                       flag_type f = regex_constants::ECMAScript);
+
+#include <regex>
+#include <cassert>
+
+int main()
+{
+    std::regex r2;
+    r2.assign(std::string("(a([bc]))"));
+    assert(r2.flags() == std::regex::ECMAScript);
+    assert(r2.mark_count() == 2);
+
+    r2.assign(std::string("(a([bc]))"), std::regex::extended);
+    assert(r2.flags() == std::regex::extended);
+    assert(r2.mark_count() == 2);
+}

Added: libcxx/trunk/test/re/re.regex/re.regex.assign/copy.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/re/re.regex/re.regex.assign/copy.pass.cpp?rev=111024&view=auto
==============================================================================
--- libcxx/trunk/test/re/re.regex/re.regex.assign/copy.pass.cpp (added)
+++ libcxx/trunk/test/re/re.regex/re.regex.assign/copy.pass.cpp Fri Aug 13 13:11:23 2010
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <regex>
+
+// template <class charT, class traits = regex_traits<charT>> class basic_regex;
+
+// basic_regex& operator=(const basic_regex& e);
+
+#include <regex>
+#include <cassert>
+
+int main()
+{
+    std::regex r1("(a([bc]))");
+    std::regex r2;
+    r2 = r1;
+    assert(r2.flags() == std::regex::ECMAScript);
+    assert(r2.mark_count() == 2);
+}

Added: libcxx/trunk/test/re/re.regex/re.regex.assign/il.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/re/re.regex/re.regex.assign/il.pass.cpp?rev=111024&view=auto
==============================================================================
--- libcxx/trunk/test/re/re.regex/re.regex.assign/il.pass.cpp (added)
+++ libcxx/trunk/test/re/re.regex/re.regex.assign/il.pass.cpp Fri Aug 13 13:11:23 2010
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <regex>
+
+// template <class charT, class traits = regex_traits<charT>> class basic_regex;
+
+// basic_regex& operator=(initializer_list<charT> il);
+
+#include <regex>
+#include <cassert>
+
+int main()
+{
+#ifdef _LIBCPP_MOVE
+    std::regex r2;
+    r2 = {'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'};
+    assert(r2.flags() == std::regex::ECMAScript);
+    assert(r2.mark_count() == 2);
+#endif
+}

Added: libcxx/trunk/test/re/re.regex/re.regex.assign/ptr.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/re/re.regex/re.regex.assign/ptr.pass.cpp?rev=111024&view=auto
==============================================================================
--- libcxx/trunk/test/re/re.regex/re.regex.assign/ptr.pass.cpp (added)
+++ libcxx/trunk/test/re/re.regex/re.regex.assign/ptr.pass.cpp Fri Aug 13 13:11:23 2010
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <regex>
+
+// template <class charT, class traits = regex_traits<charT>> class basic_regex;
+
+// basic_regex& operator=(const charT* ptr);
+
+#include <regex>
+#include <cassert>
+
+int main()
+{
+    std::regex r2;
+    r2 = "(a([bc]))";
+    assert(r2.flags() == std::regex::ECMAScript);
+    assert(r2.mark_count() == 2);
+}

Added: libcxx/trunk/test/re/re.regex/re.regex.assign/string.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/re/re.regex/re.regex.assign/string.pass.cpp?rev=111024&view=auto
==============================================================================
--- libcxx/trunk/test/re/re.regex/re.regex.assign/string.pass.cpp (added)
+++ libcxx/trunk/test/re/re.regex/re.regex.assign/string.pass.cpp Fri Aug 13 13:11:23 2010
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <regex>
+
+// template <class charT, class traits = regex_traits<charT>> class basic_regex;
+
+// template <class ST, class SA>
+//    basic_regex& operator=(const basic_string<charT, ST, SA>& p);
+
+#include <regex>
+#include <cassert>
+
+int main()
+{
+    std::regex r2;
+    r2 = std::string("(a([bc]))");
+    assert(r2.flags() == std::regex::ECMAScript);
+    assert(r2.mark_count() == 2);
+}

Added: libcxx/trunk/test/re/re.regex/re.regex.construct/copy.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/re/re.regex/re.regex.construct/copy.pass.cpp?rev=111024&view=auto
==============================================================================
--- libcxx/trunk/test/re/re.regex/re.regex.construct/copy.pass.cpp (added)
+++ libcxx/trunk/test/re/re.regex/re.regex.construct/copy.pass.cpp Fri Aug 13 13:11:23 2010
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <regex>
+
+// template <class charT, class traits = regex_traits<charT>> class basic_regex;
+
+// basic_regex(const basic_regex& e);
+
+#include <regex>
+#include <cassert>
+
+int main()
+{
+    std::regex r1("(a([bc]))");
+    std::regex r2 = r1;
+    assert(r2.flags() == std::regex::ECMAScript);
+    assert(r2.mark_count() == 2);
+}

Modified: libcxx/trunk/test/re/re.regex/re.regex.construct/ptr.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/re/re.regex/re.regex.construct/ptr.pass.cpp?rev=111024&r1=111023&r2=111024&view=diff
==============================================================================
--- libcxx/trunk/test/re/re.regex/re.regex.construct/ptr.pass.cpp (original)
+++ libcxx/trunk/test/re/re.regex/re.regex.construct/ptr.pass.cpp Fri Aug 13 13:11:23 2010
@@ -13,8 +13,6 @@
 
 // basic_regex(const charT* p);
 
-#include <iostream>
-
 #include <regex>
 #include <cassert>
 

Modified: libcxx/trunk/test/re/re.regex/re.regex.construct/ptr_flg.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/re/re.regex/re.regex.construct/ptr_flg.pass.cpp?rev=111024&r1=111023&r2=111024&view=diff
==============================================================================
--- libcxx/trunk/test/re/re.regex/re.regex.construct/ptr_flg.pass.cpp (original)
+++ libcxx/trunk/test/re/re.regex/re.regex.construct/ptr_flg.pass.cpp Fri Aug 13 13:11:23 2010
@@ -13,8 +13,6 @@
 
 // basic_regex(const charT* p, flag_type f = regex_constants::ECMAScript);
 
-#include <iostream>
-
 #include <regex>
 #include <cassert>
 

Modified: libcxx/trunk/test/re/re.regex/re.regex.construct/string_flg.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/re/re.regex/re.regex.construct/string_flg.pass.cpp?rev=111024&r1=111023&r2=111024&view=diff
==============================================================================
--- libcxx/trunk/test/re/re.regex/re.regex.construct/string_flg.pass.cpp (original)
+++ libcxx/trunk/test/re/re.regex/re.regex.construct/string_flg.pass.cpp Fri Aug 13 13:11:23 2010
@@ -15,8 +15,6 @@
 //    basic_regex(const basic_string<charT, ST, SA>& s,
 //                flag_type f = regex_constants::ECMAScript);
 
-#include <iostream>
-
 #include <regex>
 #include <cassert>
 

Added: libcxx/trunk/test/re/re.regex/re.regex.locale/imbue.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/re/re.regex/re.regex.locale/imbue.pass.cpp?rev=111024&view=auto
==============================================================================
--- libcxx/trunk/test/re/re.regex/re.regex.locale/imbue.pass.cpp (added)
+++ libcxx/trunk/test/re/re.regex/re.regex.locale/imbue.pass.cpp Fri Aug 13 13:11:23 2010
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <regex>
+
+// template <class charT, class traits = regex_traits<charT>> class basic_regex;
+
+// locale_type imbue(locale_type loc);
+
+#include <regex>
+#include <locale>
+#include <cassert>
+
+int main()
+{
+    std::regex r;
+    std::locale loc = r.imbue(std::locale("en_US"));
+    assert(loc.name() == "C");
+    assert(r.getloc().name() == "en_US");
+    loc = r.imbue(std::locale("C"));
+    assert(loc.name() == "en_US");
+    assert(r.getloc().name() == "C");
+}

Added: libcxx/trunk/test/re/re.regex/re.regex.nonmemb/nothing_to_do.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/re/re.regex/re.regex.nonmemb/nothing_to_do.pass.cpp?rev=111024&view=auto
==============================================================================
--- libcxx/trunk/test/re/re.regex/re.regex.nonmemb/nothing_to_do.pass.cpp (added)
+++ libcxx/trunk/test/re/re.regex/re.regex.nonmemb/nothing_to_do.pass.cpp Fri Aug 13 13:11:23 2010
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}

Added: libcxx/trunk/test/re/re.regex/re.regex.nonmemb/re.regex.nmswap/swap.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/re/re.regex/re.regex.nonmemb/re.regex.nmswap/swap.pass.cpp?rev=111024&view=auto
==============================================================================
--- libcxx/trunk/test/re/re.regex/re.regex.nonmemb/re.regex.nmswap/swap.pass.cpp (added)
+++ libcxx/trunk/test/re/re.regex/re.regex.nonmemb/re.regex.nmswap/swap.pass.cpp Fri Aug 13 13:11:23 2010
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <regex>
+
+// template <class charT, class traits = regex_traits<charT>> class basic_regex;
+
+// template <class charT, class traits>
+//   void swap(basic_regex<charT, traits>& lhs, basic_regex<charT, traits>& rhs);
+
+#include <regex>
+#include <cassert>
+
+int main()
+{
+    std::regex r1("(a([bc]))");
+    std::regex r2;
+    swap(r2, r1);
+    assert(r1.flags() == std::regex::ECMAScript);
+    assert(r1.mark_count() == 0);
+    assert(r2.flags() == std::regex::ECMAScript);
+    assert(r2.mark_count() == 2);
+}

Added: libcxx/trunk/test/re/re.regex/re.regex.operations/tested_elsewhere.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/re/re.regex/re.regex.operations/tested_elsewhere.pass.cpp?rev=111024&view=auto
==============================================================================
--- libcxx/trunk/test/re/re.regex/re.regex.operations/tested_elsewhere.pass.cpp (added)
+++ libcxx/trunk/test/re/re.regex/re.regex.operations/tested_elsewhere.pass.cpp Fri Aug 13 13:11:23 2010
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}

Added: libcxx/trunk/test/re/re.regex/re.regex.swap/swap.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/re/re.regex/re.regex.swap/swap.pass.cpp?rev=111024&view=auto
==============================================================================
--- libcxx/trunk/test/re/re.regex/re.regex.swap/swap.pass.cpp (added)
+++ libcxx/trunk/test/re/re.regex/re.regex.swap/swap.pass.cpp Fri Aug 13 13:11:23 2010
@@ -0,0 +1,28 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <regex>
+
+// template <class charT, class traits = regex_traits<charT>> class basic_regex;
+
+// void swap(basic_regex& e);
+
+#include <regex>
+#include <cassert>
+
+int main()
+{
+    std::regex r1("(a([bc]))");
+    std::regex r2;
+    r2.swap(r1);
+    assert(r1.flags() == std::regex::ECMAScript);
+    assert(r1.mark_count() == 0);
+    assert(r2.flags() == std::regex::ECMAScript);
+    assert(r2.mark_count() == 2);
+}

Modified: libcxx/trunk/test/re/re.traits/lookup_collatename.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/re/re.traits/lookup_collatename.pass.cpp?rev=111024&r1=111023&r2=111024&view=diff
==============================================================================
--- libcxx/trunk/test/re/re.traits/lookup_collatename.pass.cpp (original)
+++ libcxx/trunk/test/re/re.traits/lookup_collatename.pass.cpp Fri Aug 13 13:11:23 2010
@@ -15,8 +15,6 @@
 //   string_type
 //   lookup_collatename(ForwardIterator first, ForwardIterator last) const;
 
-#include <iostream>
-
 #include <regex>
 #include <iterator>
 #include <cassert>

Modified: libcxx/trunk/test/re/re.traits/transform_primary.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/re/re.traits/transform_primary.pass.cpp?rev=111024&r1=111023&r2=111024&view=diff
==============================================================================
--- libcxx/trunk/test/re/re.traits/transform_primary.pass.cpp (original)
+++ libcxx/trunk/test/re/re.traits/transform_primary.pass.cpp Fri Aug 13 13:11:23 2010
@@ -16,8 +16,6 @@
 //   string_type
 //   transform_primary(ForwardIterator first, ForwardIterator last) const;
 
-#include <iostream>
-
 #include <regex>
 #include <cassert>
 #include "iterators.h"

Modified: libcxx/trunk/test/re/re.traits/value.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/re/re.traits/value.pass.cpp?rev=111024&r1=111023&r2=111024&view=diff
==============================================================================
--- libcxx/trunk/test/re/re.traits/value.pass.cpp (original)
+++ libcxx/trunk/test/re/re.traits/value.pass.cpp Fri Aug 13 13:11:23 2010
@@ -13,8 +13,6 @@
 
 // int value(charT ch, int radix) const;
 
-#include <iostream>
-
 #include <regex>
 #include <cassert>
 





More information about the cfe-commits mailing list