From: Joseph Myers Date: Tue, 9 Nov 2004 21:22:27 +0000 (+0000) Subject: re PR c/18322 (__func__ diagnostic in bad location) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8b17a9d698ae32a281cb05521b5d3e3ef0ec6c0b;p=gcc.git re PR c/18322 (__func__ diagnostic in bad location) PR c/18322 * c-common.c (fname_decl): Don't use line number of decl in diagnostic. testsuite: * gcc.dg/func-outside-1.c, gcc.dg/func-outside-2.c: Correct expected diagnostic location. From-SVN: r90365 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 76b4af76da7..7b745eeeb69 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-11-09 Joseph S. Myers + + PR c/18322 + * c-common.c (fname_decl): Don't use line number of decl in + diagnostic. + 2004-11-09 Ulrich Weigand * config/s390/s390-protos.h (s390_pool_operand): Remove. diff --git a/gcc/c-common.c b/gcc/c-common.c index 3a13dc78822..413508e50dd 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -828,7 +828,7 @@ fname_decl (unsigned int rid, tree id) input_location = saved_location; } if (!ix && !current_function_decl) - pedwarn ("%J%qD is not defined outside of function scope", decl, decl); + pedwarn ("%qD is not defined outside of function scope", decl); return decl; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 66df19999b2..df1eaa3b8ed 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2004-11-09 Joseph S. Myers + + PR c/18322 + * gcc.dg/func-outside-1.c, gcc.dg/func-outside-2.c: Correct + expected diagnostic location. + 2004-11-09 Ulrich Weigand * gcc.dg/20041109-1.c: New test. diff --git a/gcc/testsuite/gcc.dg/func-outside-1.c b/gcc/testsuite/gcc.dg/func-outside-1.c index fcf233f8a6b..61c343bc8fe 100644 --- a/gcc/testsuite/gcc.dg/func-outside-1.c +++ b/gcc/testsuite/gcc.dg/func-outside-1.c @@ -4,6 +4,6 @@ /* { dg-do compile } */ /* { dg-options "" } */ -const char *a = __func__; /* { dg-warning "warning: '__func__' is not defined outside of function scope" "undef" { target *-*-* } 0 } */ +const char *a = __func__; /* { dg-warning "warning: '__func__' is not defined outside of function scope" "undef" } */ const char *b = __FUNCTION__; const char *c = __PRETTY_FUNCTION__; diff --git a/gcc/testsuite/gcc.dg/func-outside-2.c b/gcc/testsuite/gcc.dg/func-outside-2.c index 4e0ff19e7c4..60a6c144c72 100644 --- a/gcc/testsuite/gcc.dg/func-outside-2.c +++ b/gcc/testsuite/gcc.dg/func-outside-2.c @@ -4,6 +4,6 @@ /* { dg-do compile } */ /* { dg-options "-pedantic-errors" } */ -const char *a = __func__; /* { dg-error "error: '__func__' is not defined outside of function scope" "undef" { target *-*-* } 0 } */ +const char *a = __func__; /* { dg-error "error: '__func__' is not defined outside of function scope" "undef" } */ const char *b = __FUNCTION__; const char *c = __PRETTY_FUNCTION__;