Commit aeda100f by Paolo Carlini Committed by Paolo Carlini

re PR c++/58362 (Wrong column number for unused parameter)

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

	PR c++/58362
	* error.c (location_of): Don't handle PARM_DECLs specially.

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

	PR c++/58362
	* g++.dg/warn/Wunused-parm-5.C: New.

From-SVN: r202402
parent c0c66032
2013-09-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58362
* error.c (location_of): Don't handle PARM_DECLs specially.
2013-09-09 Paolo Carlini <paolo.carlini@oracle.com>
* error.c (dump_expr, [PSEUDO_DTOR_EXPR]): Fix.
* cxx-pretty-print.c (cxx_pretty_printer::postfix_expression):
Tweak, TREE_OPERAND (t, 1) may be null.
......
......@@ -2789,9 +2789,7 @@ lang_decl_name (tree decl, int v, bool translate)
location_t
location_of (tree t)
{
if (TREE_CODE (t) == PARM_DECL && DECL_CONTEXT (t))
t = DECL_CONTEXT (t);
else if (TYPE_P (t))
if (TYPE_P (t))
{
t = TYPE_MAIN_DECL (t);
if (t == NULL_TREE)
......
2013-09-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58362
* g++.dg/warn/Wunused-parm-5.C: New.
2013-09-09 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* gcc.target/aarch64/cmn-neg.c: New test.
......
// PR c++/58362
// { dg-options "-Wunused-parameter" }
void f1 (long s) { } // { dg-warning "15:unused parameter 's'" }
void f2 (long s, int u) { } // { dg-warning "15:unused parameter 's'" }
// { dg-warning "22:unused parameter 'u'" "" { target *-*-* } 6 }
void f3 (long s);
void f3 (long s) { } // { dg-warning "15:unused parameter 's'" }
void f4 (long s, int u);
void f4 (long s, int u) { } // { dg-warning "15:unused parameter 's'" }
// { dg-warning "22:unused parameter 'u'" "" { target *-*-* } 13 }
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