File tree Expand file tree Collapse file tree 3 files changed +54
-12
lines changed
test/libcxx/containers/associative Expand file tree Collapse file tree 3 files changed +54
-12
lines changed Original file line number Diff line number Diff line change @@ -646,12 +646,7 @@ public:
646
646
using reference = value_type&;
647
647
using pointer = __rebind_pointer_t <_NodePtr, value_type>;
648
648
649
- _LIBCPP_HIDE_FROM_ABI __tree_iterator () _NOEXCEPT
650
- #if _LIBCPP_STD_VER >= 14
651
- : __ptr_(nullptr )
652
- #endif
653
- {
654
- }
649
+ _LIBCPP_HIDE_FROM_ABI __tree_iterator () _NOEXCEPT : __ptr_(nullptr ) {}
655
650
656
651
_LIBCPP_HIDE_FROM_ABI reference operator *() const { return __get_np ()->__value_ ; }
657
652
_LIBCPP_HIDE_FROM_ABI pointer operator ->() const { return pointer_traits<pointer>::pointer_to (__get_np ()->__value_ ); }
@@ -720,12 +715,7 @@ public:
720
715
using reference = const value_type&;
721
716
using pointer = __rebind_pointer_t <_NodePtr, const value_type>;
722
717
723
- _LIBCPP_HIDE_FROM_ABI __tree_const_iterator () _NOEXCEPT
724
- #if _LIBCPP_STD_VER >= 14
725
- : __ptr_(nullptr )
726
- #endif
727
- {
728
- }
718
+ _LIBCPP_HIDE_FROM_ABI __tree_const_iterator () _NOEXCEPT : __ptr_(nullptr ) {}
729
719
730
720
private:
731
721
typedef __tree_iterator<_Tp, __node_pointer, difference_type> __non_const_iterator;
Original file line number Diff line number Diff line change
1
+ // ===----------------------------------------------------------------------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ // ===----------------------------------------------------------------------===//
8
+
9
+ // UNSUPPORTED: c++03
10
+
11
+ // Check that map::iterator is initialized when default constructed
12
+
13
+ #include < cassert>
14
+ #include < map>
15
+
16
+ template <class Iter >
17
+ void test () {
18
+ Iter iter;
19
+ Iter iter2 = Iter ();
20
+ assert (iter == iter2);
21
+ }
22
+
23
+ int main () {
24
+ test<std::map<int , int >::iterator>();
25
+ test<std::map<int , int >::const_iterator>();
26
+ }
Original file line number Diff line number Diff line change
1
+ // ===----------------------------------------------------------------------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ // ===----------------------------------------------------------------------===//
8
+
9
+ // UNSUPPORTED: c++03
10
+
11
+ // Check that set::iterator is initialized when default constructed
12
+
13
+ #include < cassert>
14
+ #include < set>
15
+
16
+ template <class Iter >
17
+ void test () {
18
+ Iter iter;
19
+ Iter iter2 = Iter ();
20
+ assert (iter == iter2);
21
+ }
22
+
23
+ int main () {
24
+ test<std::set<int >::iterator>();
25
+ test<std::set<int >::const_iterator>();
26
+ }
You can’t perform that action at this time.
0 commit comments