[clang-tools-extra] r310470 - [clangd] Fixed a bug in make_tagged.

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 9 05:55:14 PDT 2017


Author: ibiryukov
Date: Wed Aug  9 05:55:13 2017
New Revision: 310470

URL: http://llvm.org/viewvc/llvm-project?rev=310470&view=rev
Log:
[clangd] Fixed a bug in make_tagged.

It accidentally std::move'd from Value parameter if it deduced to an
l-value ref.

Modified:
    clang-tools-extra/trunk/clangd/ClangdServer.h

Modified: clang-tools-extra/trunk/clangd/ClangdServer.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/ClangdServer.h?rev=310470&r1=310469&r2=310470&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/ClangdServer.h (original)
+++ clang-tools-extra/trunk/clangd/ClangdServer.h Wed Aug  9 05:55:13 2017
@@ -66,7 +66,7 @@ public:
 
 template <class T>
 Tagged<typename std::decay<T>::type> make_tagged(T &&Value, VFSTag Tag) {
-  return Tagged<T>(std::forward<T>(Value), Tag);
+  return Tagged<typename std::decay<T>::type>(std::forward<T>(Value), Tag);
 }
 
 class DiagnosticsConsumer {




More information about the cfe-commits mailing list