summaryrefslogtreecommitdiffstats
path: root/tools/clang-tidy/test/modernize-shrink-to-fit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/clang-tidy/test/modernize-shrink-to-fit.cpp')
-rw-r--r--tools/clang-tidy/test/modernize-shrink-to-fit.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/clang-tidy/test/modernize-shrink-to-fit.cpp b/tools/clang-tidy/test/modernize-shrink-to-fit.cpp
new file mode 100644
index 0000000000..c545a517a3
--- /dev/null
+++ b/tools/clang-tidy/test/modernize-shrink-to-fit.cpp
@@ -0,0 +1,10 @@
+#include "structures.h"
+
+void f() {
+ std::vector<int> v;
+
+ std::vector<int>(v).swap(v);
+
+ std::vector<int> &vref = v;
+ std::vector<int>(vref).swap(vref);
+}