| 1 |
// RUN: %clang_cc1 -verify -std=c++20 -Wall %s |
| 2 |
// RUN: cp %s %t |
| 3 |
// RUN: %clang_cc1 -x c++ -std=c++20 -fixit %t |
| 4 |
// RUN: %clang_cc1 -Wall -Werror -x c++ -std=c++20 %t |
| 5 |
// RUN: cat %t | FileCheck %s |
| 6 |
|
| 7 |
namespace std { |
| 8 |
|
| 9 |
int &&move(auto &&a) { return a; } |
| 10 |
|
| 11 |
int &&forward(auto &a) { return a; } |
| 12 |
|
| 13 |
} // namespace std |
| 14 |
|
| 15 |
using namespace std; |
| 16 |
|
| 17 |
void f() { |
| 18 |
int i = 0; |
| 19 |
(void)move(i); // expected-warning {{unqualified call to 'std::move}} |
| 20 |
// CHECK: {{^}} (void)std::move |
| 21 |
(void)forward(i); // expected-warning {{unqualified call to 'std::forward}} |
| 22 |
// CHECK: {{^}} (void)std::forward |
| 23 |
} |