| //===----------------------------------------------------------------------===// |
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| // See https://llvm.org/LICENSE.txt for license information. |
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| //===----------------------------------------------------------------------===// |
| const A csource() {return A();} |
| std::forward<A&>(source()); // expected-note {{requested here}} |
| // expected-error-re@type_traits:* 1 {{static_assert failed{{.*}} "can not forward an rvalue as an lvalue"}} |
| std::forward<A&>(source()); // expected-error {{no matching function for call to 'forward'}} |
| std::forward<A&>(ca); // expected-error {{no matching function for call to 'forward'}} |
| std::forward<A&>(csource()); // expected-error {{no matching function for call to 'forward'}} |
| std::forward<A>(ca); // expected-error {{no matching function for call to 'forward'}} |
| std::forward<A>(csource()); // expected-error {{no matching function for call to 'forward'}} |
| std::forward(a); // expected-error {{no matching function for call to 'forward'}} |