<div dir="ltr">Sorry, I'll make a better commit message next time.  Yes, it's tricky in the face of a macro, but what I ultimately decided is that the user of the macro is responsible for writing EXPECT_ERROR(std::move(E)) if he/she does not have a temporary.</div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jun 1, 2016 at 11:14 PM David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Jun 1, 2016 at 11:18 AM, Zachary Turner via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: zturner<br>
Date: Wed Jun  1 13:18:55 2016<br>
New Revision: 271420<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=271420&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=271420&view=rev</a><br>
Log:<br>
[pdb] silence warnings about moving from a temporary.<br></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>FWIW: When I read "silence warnings" I think the change involves suppressing the compiler warning without changing the semantics of the code - that makes me suspicious/go and look at the change to see if it's addressed the compiler warning or just worked around it. At least for me, I'd find "fix warnings about std::move of a temporary" to be a more apt/less interesting description of this change (& some other recent ones too)<br><br>That said, this warning is tricky in the face of a macro - but I assume the only thing ever passed to the macro is a single expression with a result of error.<br><br>Also, might want to put some ()s in there:<br><br>auto E = (Err);<br><br>Just in case anyone does anything weird... (comma operator, etc)<br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Modified:<br>
    llvm/trunk/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp<br>
<br>
Modified: llvm/trunk/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp?rev=271420&r1=271419&r2=271420&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp?rev=271420&r1=271419&r2=271420&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp (original)<br>
+++ llvm/trunk/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp Wed Jun  1 13:18:55 2016<br>
@@ -23,7 +23,7 @@ namespace {<br>
<br>
 #define EXPECT_NO_ERROR(Err)                                                   \<br>
   {                                                                            \<br>
-    auto E = std::move(Err);                                                   \<br>
+    auto E = Err;                                                              \<br>
     EXPECT_FALSE(static_cast<bool>(E));                                        \<br>
     if (E)                                                                     \<br>
       consumeError(std::move(E));                                              \<br>
@@ -31,7 +31,7 @@ namespace {<br>
<br>
 #define EXPECT_ERROR(Err)                                                      \<br>
   {                                                                            \<br>
-    auto E = std::move(Err);                                                   \<br>
+    auto E = Err;                                                              \<br>
     EXPECT_TRUE(static_cast<bool>(E));                                         \<br>
     if (E)                                                                     \<br>
       consumeError(std::move(E));                                              \<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div></div></div></blockquote></div>