From 19b5520abfb5f66d4b83c7a18cc72d68673d098a Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 10 Apr 2020 11:50:40 +0200 Subject: [PATCH] Work around compiler problems on MSVC 16.6.X The compiler apparently doesn't resolve the emplace overload correctly to the rvalue version, leading to infinite recursion in the overload that takes a const Key & as argument. Take a copy to make it explicit. Change-Id: I22039d6ca1e2176c81e51b181c72f511dab662f7 Reviewed-by: Lars Knoll --- src/corelib/tools/qhash.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index 8825372c03..eacc373ee3 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -1121,7 +1121,8 @@ public: template iterator emplace(const Key &key, Args &&... args) { - return emplace(Key(key), std::forward(args)...); + Key copy = key; // Needs to be explicit for MSVC 2019 + return emplace(std::move(copy), std::forward(args)...); } template