mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 20:46:05 +00:00

Replaces some prior ad-hoc detection strategies and generally cleans up a little. No functional change intended.
24 lines
578 B
C++
24 lines
578 B
C++
// RUN: %clang_cc1 -verify -std=c++20 -Wall %s
|
|
// RUN: cp %s %t
|
|
// RUN: %clang_cc1 -x c++ -std=c++20 -fixit %t
|
|
// RUN: %clang_cc1 -Wall -Werror -x c++ -std=c++20 %t
|
|
// RUN: cat %t | FileCheck %s
|
|
|
|
namespace std {
|
|
|
|
int &&move(auto &&a) { return a; }
|
|
|
|
int &&forward(auto &a) { return a; }
|
|
|
|
} // namespace std
|
|
|
|
using namespace std;
|
|
|
|
void f() {
|
|
int i = 0;
|
|
(void)move(i); // expected-warning {{unqualified call to 'std::move}}
|
|
// CHECK: {{^}} (void)std::move
|
|
(void)forward(i); // expected-warning {{unqualified call to 'std::forward}}
|
|
// CHECK: {{^}} (void)std::forward
|
|
}
|