@@ -78,71 +78,71 @@ void test_ref(InitArgs&&... args)
7878 assert (&(*lhs) == &(*rhs));
7979}
8080
81- void test_reference_extension ()
82- {
83- #if defined(_LIBCPP_VERSION) && 0 // FIXME these extensions are currently disabled.
84- using T = TestTypes::TestType;
85- T::reset ();
86- {
87- T t;
88- T::reset_constructors ();
89- test_ref<T&>();
90- test_ref<T&>(t);
91- assert (T::alive == 1 );
92- assert (T::constructed == 0 );
93- assert (T::assigned == 0 );
94- assert (T::destroyed == 0 );
95- }
96- assert (T::destroyed == 1 );
97- assert (T::alive == 0 );
98- {
99- T t;
100- const T& ct = t;
101- T::reset_constructors ();
102- test_ref<T const &>();
103- test_ref<T const &>(t);
104- test_ref<T const &>(ct);
105- assert (T::alive == 1 );
106- assert (T::constructed == 0 );
107- assert (T::assigned == 0 );
108- assert (T::destroyed == 0 );
109- }
110- assert (T::alive == 0 );
111- assert (T::destroyed == 1 );
112- {
113- T t;
114- T::reset_constructors ();
115- test_ref<T&&>();
116- test_ref<T&&>(std::move (t));
117- assert (T::alive == 1 );
118- assert (T::constructed == 0 );
119- assert (T::assigned == 0 );
120- assert (T::destroyed == 0 );
121- }
122- assert (T::alive == 0 );
123- assert (T::destroyed == 1 );
124- {
125- T t;
126- const T& ct = t;
127- T::reset_constructors ();
128- test_ref<T const &&>();
129- test_ref<T const &&>(std::move (t));
130- test_ref<T const &&>(std::move (ct));
131- assert (T::alive == 1 );
132- assert (T::constructed == 0 );
133- assert (T::assigned == 0 );
134- assert (T::destroyed == 0 );
135- }
136- assert (T::alive == 0 );
137- assert (T::destroyed == 1 );
138- {
139- static_assert (!std::is_copy_constructible<std::optional<T&&>>::value, " " );
140- static_assert (!std::is_copy_constructible<std::optional<T const &&>>::value, " " );
141- }
81+ void test_reference_extension () {
82+ #if TEST_STD_VER >= 26
83+ using T = TestTypes::TestType;
84+ T::reset ();
85+ {
86+ T t;
87+ T::reset_constructors ();
88+ test_ref<T&>();
89+ test_ref<T&>(t);
90+ assert (T::alive == 1 );
91+ assert (T::constructed == 0 );
92+ assert (T::assigned == 0 );
93+ assert (T::destroyed == 0 );
94+ }
95+ assert (T::destroyed == 1 );
96+ assert (T::alive == 0 );
97+ {
98+ T t;
99+ const T& ct = t;
100+ T::reset_constructors ();
101+ test_ref<T const &>();
102+ test_ref<T const &>(t);
103+ test_ref<T const &>(ct);
104+ assert (T::alive == 1 );
105+ assert (T::constructed == 0 );
106+ assert (T::assigned == 0 );
107+ assert (T::destroyed == 0 );
108+ }
109+ assert (T::alive == 0 );
110+ assert (T::destroyed == 1 );
111+ # if 0 // FIXME: optional<T&&> is not allowed.
112+ {
113+ T t;
114+ T::reset_constructors ();
115+ test_ref<T&&>();
116+ test_ref<T&&>(std::move (t));
117+ assert (T::alive == 1 );
118+ assert (T::constructed == 0 );
119+ assert (T::assigned == 0 );
120+ assert (T::destroyed == 0 );
121+ }
122+ assert (T::alive == 0 );
123+ assert (T::destroyed == 1 );
124+ {
125+ T t;
126+ const T& ct = t;
127+ T::reset_constructors ();
128+ test_ref<T const &&>();
129+ test_ref<T const &&>(std::move (t));
130+ test_ref<T const &&>(std::move (ct));
131+ assert (T::alive == 1 );
132+ assert (T::constructed == 0 );
133+ assert (T::assigned == 0 );
134+ assert (T::destroyed == 0 );
135+ }
136+ assert (T::alive == 0 );
137+ assert (T::destroyed == 1 );
138+ {
139+ static_assert (!std::is_copy_constructible<std::optional<T&&>>::value, " " );
140+ static_assert (!std::is_copy_constructible<std::optional<T const &&>>::value, " " );
141+ }
142+ # endif
142143#endif
143144}
144145
145-
146146int main (int , char **)
147147{
148148 test<int >();
0 commit comments