PR c++/87080
* typeck.c (maybe_warn_pessimizing_move): Do nothing in a template.
* g++.dg/cpp0x/Wpessimizing-move5.C: New test.
From-SVN: r263862
+2018-08-26 Marek Polacek <polacek@redhat.com>
+
+ PR c++/87080
+ * typeck.c (maybe_warn_pessimizing_move): Do nothing in a template.
+
2018-08-24 Marek Polacek <polacek@redhat.com>
PR c++/67012
if (cxx_dialect < cxx11)
return;
+ /* Wait until instantiation time, since we can't gauge if we should do
+ the NRVO until then. */
+ if (processing_template_decl)
+ return;
+
/* This is only interesting for class types. */
if (!CLASS_TYPE_P (functype))
return;
+2018-08-26 Marek Polacek <polacek@redhat.com>
+
+ PR c++/87080
+ * g++.dg/cpp0x/Wpessimizing-move5.C: New test.
+
2018-08-25 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/86704
--- /dev/null
+// PR c++/87080
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wpessimizing-move" }
+
+struct a {
+ template<typename b> a &operator<<(b);
+};
+a c();
+template<typename>
+a fn2()
+{
+ int d = 42;
+ return c() << d;
+}