xref: /llvm-project/clang/test/SemaCXX/unqualified-std-call-fixits.cpp (revision f6a5ab6c8c316fa4f60e40030586e230920a63ea)
170b1f6deSCorentin Jabot // RUN: %clang_cc1 -verify -std=c++20 -Wall %s
270b1f6deSCorentin Jabot // RUN: cp %s %t
370b1f6deSCorentin Jabot // RUN: %clang_cc1 -x c++ -std=c++20 -fixit %t
470b1f6deSCorentin Jabot // RUN: %clang_cc1 -Wall -Werror -x c++ -std=c++20 %t
570b1f6deSCorentin Jabot // RUN: cat %t | FileCheck %s
670b1f6deSCorentin Jabot 
770b1f6deSCorentin Jabot namespace std {
870b1f6deSCorentin Jabot 
move(auto && a)972315d02SRichard Smith int &&move(auto &&a) { return a; }
1070b1f6deSCorentin Jabot 
forward(auto & a)1172315d02SRichard Smith int &&forward(auto &a) { return a; }
1270b1f6deSCorentin Jabot 
1370b1f6deSCorentin Jabot } // namespace std
1470b1f6deSCorentin Jabot 
1570b1f6deSCorentin Jabot using namespace std;
1670b1f6deSCorentin Jabot 
f()1770b1f6deSCorentin Jabot void f() {
1870b1f6deSCorentin Jabot   int i = 0;
19*f6a5ab6cSRichard Smith   (void)move(i); // expected-warning {{unqualified call to 'std::move}}
2072315d02SRichard Smith   // CHECK: {{^}}  (void)std::move
21*f6a5ab6cSRichard Smith   (void)forward(i); // expected-warning {{unqualified call to 'std::forward}}
2272315d02SRichard Smith   // CHECK: {{^}}  (void)std::forward
2370b1f6deSCorentin Jabot }
24