@@ -30,18 +30,11 @@ namespace std {
30
30
template <typename T> struct remove_reference <T&> { using type = T; };
31
31
template <typename T> struct remove_reference <T&&> { using type = T; };
32
32
33
- template <typename T> struct is_lvalue_reference { static constexpr bool value = false ; };
34
- template <typename T> struct is_lvalue_reference <T&> { static constexpr bool value = true ; };
35
-
36
33
template <typename T> CONSTEXPR T &&forward(typename remove_reference<T>::type &x) {
37
34
static_assert (T::moveable, " instantiated forward" ); // expected-error {{no member named 'moveable' in 'B'}}
38
35
// expected-error@-1 {{no member named 'moveable' in 'C'}}
39
36
return static_cast <T&&>(x);
40
37
}
41
- template <typename T> CONSTEXPR T &&forward(typename remove_reference<T>::type &&x) {
42
- static_assert (!is_lvalue_reference<T>::value, " should not forward rval as lval" ); // expected-error {{static_assert failed}}
43
- return static_cast <T&&>(x);
44
- }
45
38
46
39
template <typename T> CONSTEXPR const T &as_const (T &x) {
47
40
static_assert (T::moveable, " instantiated as_const" ); // expected-error {{no member named 'moveable' in 'B'}}
@@ -83,11 +76,6 @@ static_assert(f({}), "should be constexpr");
83
76
// expected-note@#call {{}}
84
77
#endif
85
78
86
- A &forward_rval_as_lval () {
87
- std::forward<A&&>(A ()); // expected-warning {{const attribute}}
88
- return std::forward<A&>(A ()); // expected-note {{instantiation of}}
89
- }
90
-
91
79
struct B {};
92
80
B &&(*pMove)(B&) = std::move; // #1 expected-note {{instantiation of}}
93
81
B &&(*pMoveIfNoexcept)(B&) = &std::move_if_noexcept; // #2 expected-note {{instantiation of}}
0 commit comments