/cp
2018-02-08 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/83806
* typeck.c (decay_conversion): Use mark_rvalue_use for the special
case of nullptr too.
/testsuite
2018-02-08 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/83806
* g++.dg/warn/Wunused-parm-11.C: New.
From-SVN: r257502
+2018-02-08 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/83806
+ * typeck.c (decay_conversion): Use mark_rvalue_use for the special
+ case of nullptr too.
+
2018-02-08 Nathan Sidwell <nathan@acm.org>
* class.c (finish_struct): Fix std:initializer_list diagnostic
return error_mark_node;
if (NULLPTR_TYPE_P (type) && !TREE_SIDE_EFFECTS (exp))
- return nullptr_node;
+ {
+ mark_rvalue_use (exp, loc, reject_builtin);
+ return nullptr_node;
+ }
/* build_c_cast puts on a NOP_EXPR to make the result not an lvalue.
Leave such NOP_EXPRs, since RHS is being used in non-lvalue context. */
+2018-02-08 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/83806
+ * g++.dg/warn/Wunused-parm-11.C: New.
+
2018-02-08 Marek Polacek <polacek@redhat.com>
PR tree-optimization/84238
--- /dev/null
+// PR c++/83806
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wunused-but-set-parameter" }
+
+template <class X, class Y>
+bool equals(X x, Y y) {
+ return (x == y);
+}
+
+int main() {
+ const char* p = nullptr;
+ equals(p, nullptr);
+}