Commit 2ac2f83d by Paolo Carlini Committed by Paolo Carlini

re PR c++/57211 (wrong line indicated in warning for synthesized method)

/cp
2013-05-22  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/57211
	* method.c (defaultable_fn_check): Avoid do_warn_unused_parameter
	warnings about defaulted functions.

/testsuite
2013-05-22  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/57211
	* g++.dg/cpp0x/Wunused-parm.C: New.

From-SVN: r199189
parent 98409b51
2013-05-22 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/57211
* method.c (defaultable_fn_check): Avoid do_warn_unused_parameter
warnings about defaulted functions.
2013-05-21 Paolo Carlini <paolo.carlini@oracle.com>
* call.c (build_conditional_expr_1): Add location_t parameter.
......
......@@ -1864,13 +1864,19 @@ defaultable_fn_check (tree fn)
}
else
{
tree t = FUNCTION_FIRST_USER_PARMTYPE (fn);
for (; t && t != void_list_node; t = TREE_CHAIN (t))
for (tree t = FUNCTION_FIRST_USER_PARMTYPE (fn);
t && t != void_list_node; t = TREE_CHAIN (t))
if (TREE_PURPOSE (t))
{
error ("defaulted function %q+D with default argument", fn);
break;
}
/* Avoid do_warn_unused_parameter warnings. */
for (tree p = FUNCTION_FIRST_USER_PARM (fn); p; p = DECL_CHAIN (p))
if (DECL_NAME (p))
TREE_NO_WARNING (p) = 1;
if (TYPE_BEING_DEFINED (DECL_CONTEXT (fn)))
/* Defer checking. */;
else if (!processing_template_decl)
......
2013-05-22 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/57211
* g++.dg/cpp0x/Wunused-parm.C: New.
2013-05-21 Paolo Carlini <paolo.carlini@oracle.com>
* g++.dg/cpp0x/explicit3.C: Add column in dg-error strings.
......
// PR c++/57211
// { dg-options "-std=c++11 -Wunused-parameter" }
template <class T> T&& move(T&);
struct A
{
struct B
{
B& operator=(B&&);
};
B f;
A& operator=(A&& p) = default;
};
int main()
{
A a;
A b;
b = move(a);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment