From 6447c55dea95705018ff2bb3de7a81c160a71d4e Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Thu, 5 Jun 2014 05:30:39 +0000 Subject: re PR c/48062 (`shadowed declaration is here' should be a note) PR c/48062 * c-decl.c (warn_if_shadowing): Call inform instead of warning_at. Print note only if the warning was printed. * gcc.dg/Wshadow-1.c: Use dg-message for "shadowed declaration". * gcc.dg/Wshadow-3.c: Likewise. * gcc.dg/pr48062.c: New test. From-SVN: r211254 --- gcc/testsuite/gcc.dg/Wshadow-1.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gcc/testsuite/gcc.dg/Wshadow-1.c') diff --git a/gcc/testsuite/gcc.dg/Wshadow-1.c b/gcc/testsuite/gcc.dg/Wshadow-1.c index 40073f337b4..6075711f5da 100644 --- a/gcc/testsuite/gcc.dg/Wshadow-1.c +++ b/gcc/testsuite/gcc.dg/Wshadow-1.c @@ -5,7 +5,7 @@ /* Source: Neil Booth, 5 Dec 2001. */ -int decl1; /* { dg-warning "shadowed declaration" } */ +int decl1; /* { dg-message "shadowed declaration" } */ void foo (double decl1) /* { dg-warning "shadows a global decl" } */ { } @@ -16,7 +16,7 @@ void foo1 (int d) /* { dg-message "note: previous definition" } */ /* { dg-error "redeclared as different" "" { target *-*-* } 15 } */ } -void foo2 (int d) /* { dg-warning "shadowed declaration" } */ +void foo2 (int d) /* { dg-message "shadowed declaration" } */ { { double d; /* { dg-warning "shadows a parameter" } */ @@ -25,7 +25,7 @@ void foo2 (int d) /* { dg-warning "shadowed declaration" } */ void foo3 () { - int local; /* { dg-warning "shadowed declaration" } */ + int local; /* { dg-message "shadowed declaration" } */ { int local; /* { dg-warning "shadows a previous local" } */ } -- cgit v1.2.1