1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
13 #include "test_macros.h"
19 A
source() {return A();}
20 const A
csource() {return A();}
25 (void)std::forward
<A
&>(source()); // expected-note {{requested here}}
26 // expected-error-re@*:* 1 {{static assertion failed{{.*}}cannot forward an rvalue as an lvalue}}
30 std::forward
<A
&>(ca
); // expected-error {{no matching function for call to 'forward'}}
33 std::forward
<A
&>(csource()); // expected-error {{no matching function for call to 'forward'}}
37 std::forward
<A
>(ca
); // expected-error {{no matching function for call to 'forward'}}
40 std::forward
<A
>(csource()); // expected-error {{no matching function for call to 'forward'}}
44 std::forward(a
); // expected-error {{no matching function for call to 'forward'}}