From 43a97878ce14b72f0981164f87f2e35e14151312 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:22:09 +0200 Subject: Adding upstream version 110.0.1. Signed-off-by: Daniel Baumann --- .../clang-tidy/test/performance-move-const-arg.cpp | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 tools/clang-tidy/test/performance-move-const-arg.cpp (limited to 'tools/clang-tidy/test/performance-move-const-arg.cpp') diff --git a/tools/clang-tidy/test/performance-move-const-arg.cpp b/tools/clang-tidy/test/performance-move-const-arg.cpp new file mode 100644 index 0000000000..39f1ce06ec --- /dev/null +++ b/tools/clang-tidy/test/performance-move-const-arg.cpp @@ -0,0 +1,33 @@ +namespace std { +template +struct remove_reference { + typedef _Tp type; +}; + +template +constexpr typename std::remove_reference<_Tp>::type &&move(_Tp &&__t) { + return static_cast::type &&>(__t); +} +} // namespace std + +struct TriviallyCopyable { + int i; +}; + +class A { +public: + A() {} + A(const A &rhs) {} + A(A &&rhs) {} +}; + +void f(TriviallyCopyable) {} + +void g() { + TriviallyCopyable obj; + f(std::move(obj)); +} + +A f5(const A x5) { + return std::move(x5); +} -- cgit v1.2.3