aboutsummaryrefslogtreecommitdiffstats
path: root/tests/detaching-temporary/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/detaching-temporary/main.cpp')
-rw-r--r--tests/detaching-temporary/main.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/detaching-temporary/main.cpp b/tests/detaching-temporary/main.cpp
index e36c22a6..2cd524c2 100644
--- a/tests/detaching-temporary/main.cpp
+++ b/tests/detaching-temporary/main.cpp
@@ -3,7 +3,7 @@
#include <QtCore/QStringList>
#include <QtCore/QMap>
#include <QtCore/QFile>
-
+#include <QtCore/QHash>
QList<int> getList()
@@ -151,3 +151,10 @@ void testQString()
getString().begin(); // Warning
getString()[1]; // Warning
}
+
+extern QHash<QString, int> &initializers();
+QString getStr() { return QString(); }
+
+static auto bar = [] {
+ return initializers().insert(getStr(), 1); // OK
+ }();