re PR c/18322 (__func__ diagnostic in bad location)
authorJoseph Myers <joseph@codesourcery.com>
Tue, 9 Nov 2004 21:22:27 +0000 (21:22 +0000)
committerJoseph Myers <jsm28@gcc.gnu.org>
Tue, 9 Nov 2004 21:22:27 +0000 (21:22 +0000)
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

gcc/ChangeLog
gcc/c-common.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/func-outside-1.c
gcc/testsuite/gcc.dg/func-outside-2.c

index 76b4af76da7d3c031c481cc9cfcb1cee12d7c871..7b745eeeb699ce18b81a13006505373df603c9d7 100644 (file)
@@ -1,3 +1,9 @@
+2004-11-09  Joseph S. Myers  <joseph@codesourcery.com>
+
+       PR c/18322
+       * c-common.c (fname_decl): Don't use line number of decl in
+       diagnostic.
+
 2004-11-09  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * config/s390/s390-protos.h (s390_pool_operand): Remove.
index 3a13dc7882296a09f207a1ac811b721a986fe8de..413508e50dd71bc56c2588f5744d2519cc0505a1 100644 (file)
@@ -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;
 }
index 66df19999b2f828712d7c456d33afc9502643afa..df1eaa3b8edae7f2503b5c84fb000d9afedcbae6 100644 (file)
@@ -1,3 +1,9 @@
+2004-11-09  Joseph S. Myers  <joseph@codesourcery.com>
+
+       PR c/18322
+       * gcc.dg/func-outside-1.c, gcc.dg/func-outside-2.c: Correct
+       expected diagnostic location.
+
 2004-11-09  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * gcc.dg/20041109-1.c: New test.
index fcf233f8a6b3b400a9347e7d61a530f3cfc7bf5b..61c343bc8fe0355248ade95cdc2b3046de015dba 100644 (file)
@@ -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__;
index 4e0ff19e7c44617950f6fef48b734d822c5057d9..60a6c144c725b2dd5e3c9969baeaa084025487e6 100644 (file)
@@ -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__;