From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- .../clang-tidy/test/performance-for-range-copy.cpp | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tools/clang-tidy/test/performance-for-range-copy.cpp (limited to 'tools/clang-tidy/test/performance-for-range-copy.cpp') diff --git a/tools/clang-tidy/test/performance-for-range-copy.cpp b/tools/clang-tidy/test/performance-for-range-copy.cpp new file mode 100644 index 0000000000..264dd42896 --- /dev/null +++ b/tools/clang-tidy/test/performance-for-range-copy.cpp @@ -0,0 +1,30 @@ +template +struct Iterator { + void operator++() {} + const T& operator*() { + static T* TT = new T(); + return *TT; + } + bool operator!=(const Iterator &) { return false; } + typedef const T& const_reference; +}; +template +struct View { + T begin() { return T(); } + T begin() const { return T(); } + T end() { return T(); } + T end() const { return T(); } + typedef typename T::const_reference const_reference; +}; + +struct S { + S(); + S(const S &); + ~S(); + S &operator=(const S &); +}; + +void negativeConstReference() { + for (const S S1 : View>()) { + } +} -- cgit v1.2.3