File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
test/std/utilities/optional/optional.specalg Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -1448,17 +1448,17 @@ _LIBCPP_HIDE_FROM_ABI constexpr optional<decay_t<_Tp>> make_optional(_Tp&& __v)
14481448
14491449template <class _Tp , class ... _Args>
14501450_LIBCPP_HIDE_FROM_ABI constexpr optional<_Tp> make_optional (_Args&&... __args) {
1451- # if _LIBCPP_STD_VER >= 26
1452- static_assert (!is_reference_v<_Tp>, " make_optional<T&, Args...> is disallowed" );
1453- # endif
1451+ # if _LIBCPP_STD_VER >= 26
1452+ static_assert (!is_reference_v<_Tp>, " make_optional<T&, Args...> is disallowed" );
1453+ # endif
14541454 return optional<_Tp>(in_place, std::forward<_Args>(__args)...);
14551455}
14561456
14571457template <class _Tp , class _Up , class ... _Args>
14581458_LIBCPP_HIDE_FROM_ABI constexpr optional<_Tp> make_optional (initializer_list<_Up> __il, _Args&&... __args) {
1459- # if _LIBCPP_STD_VER >= 26
1460- static_assert (!is_reference_v<_Tp>, " make_optional<T&, Args...> is disallowed" );
1461- # endif
1459+ # if _LIBCPP_STD_VER >= 26
1460+ static_assert (!is_reference_v<_Tp>, " make_optional<T&, Args...> is disallowed" );
1461+ # endif
14621462 return optional<_Tp>(in_place, __il, std::forward<_Args>(__args)...);
14631463}
14641464
Original file line number Diff line number Diff line change 1313// template <class T, class... Args>
1414// constexpr optional<T> make_optional(Args&&... args);
1515
16- #include < optional>
16+ #include < optional>
1717
18- struct Foo {
18+ struct Foo {
1919 int x, y;
2020};
2121
@@ -31,7 +31,7 @@ int main(int, char**) {
3131 // expected-error-re@optional:* 3 {{static assertion failed{{.*}} make_optional<T&, Args...> is disallowed}}
3232 std::make_optional<X&>(i);
3333 std::make_optional<int &>(1 );
34- std::make_optional<Foo&>(1 ,2 );
34+ std::make_optional<Foo&>(1 , 2 );
3535
3636 // FIXME: Garbage error messages that Clang produces after the static_assert is triggered
3737 // expected-error-re@optional:* 0+ {{no matching constructor for initialization of 'optional<{{.*}}>'}}
You can’t perform that action at this time.
0 commit comments