diff options
author | Marek Polacek <polacek@redhat.com> | 2014-06-05 05:30:39 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2014-06-05 05:30:39 +0000 |
commit | 6447c55dea95705018ff2bb3de7a81c160a71d4e (patch) | |
tree | c4f8e2e13a568c7cf9471b9cf3520957becc359c /gcc/testsuite/gcc.dg/Wshadow-1.c | |
parent | 1f5dc1b6f06b4dde9538d81e341feae7d9c9c441 (diff) | |
download | gcc-6447c55dea95705018ff2bb3de7a81c160a71d4e.tar.gz |
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
Diffstat (limited to 'gcc/testsuite/gcc.dg/Wshadow-1.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/Wshadow-1.c | 6 |
1 files changed, 3 insertions, 3 deletions
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" } */ } |