diff options
author | Luis Felipe Strano Moraes <luis.strano@gmail.com> | 2015-07-27 22:26:34 +0000 |
---|---|---|
committer | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2015-07-27 22:26:34 +0000 |
commit | 463084746c84205b40c855f1612fcee978d25a4f (patch) | |
tree | f9ad9ba10d8ebce2eaecafbc8ad4e75c3e8bf664 /gcc | |
parent | 160654a0b8108509f30cef9c3b726e330f8c5451 (diff) | |
download | gcc-463084746c84205b40c855f1612fcee978d25a4f.zip gcc-463084746c84205b40c855f1612fcee978d25a4f.tar.gz gcc-463084746c84205b40c855f1612fcee978d25a4f.tar.bz2 |
c-decl.c (get_parm_info): Remove static var.
gcc/c/ChangeLog
2015-07-28 Luis Felipe Strano Moraes <luis.strano@gmail.com>
Manuel López-Ibáñez <manu@gcc.gnu.org>
* c-decl.c (get_parm_info): Remove static var. Update warning
message.
gcc/testsuite/ChangeLog
2015-07-28 Luis Felipe Strano Moraes <luis.strano@gmail.com>
Manuel López-Ibáñez <manu@gcc.gnu.org>
* gcc.dg/parm-incomplete-1.c: Update.
* gcc.dg/pr18809-1.c: Update.
* gcc.dg/pr27953.c: Update.
* gcc.dg/vla-11.c: Update.
Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org>
From-SVN: r226274
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c/c-decl.c | 20 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/parm-incomplete-1.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr18809-1.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr27953.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vla-11.c | 1 |
7 files changed, 22 insertions, 16 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 08d6246..708d3bf 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,9 @@ +2015-07-28 Luis Felipe Strano Moraes <luis.strano@gmail.com> + Manuel López-Ibáñez <manu@gcc.gnu.org> + + * c-decl.c (get_parm_info): Remove static var. Update warning + message. + 2015-07-27 Marek Polacek <polacek@redhat.com> PR c++/66555 diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index 8b02877..2669764 100644 --- a/gcc/c/c-decl.c +++ b/gcc/c/c-decl.c @@ -6897,7 +6897,6 @@ get_parm_info (bool ellipsis, tree expr) tree types = 0; tree others = 0; - static bool explained_incomplete_types = false; bool gave_void_only_once_err = false; arg_info->had_vla_unspec = current_scope->had_vla_unspec; @@ -7000,19 +6999,16 @@ get_parm_info (bool ellipsis, tree expr) { if (b->id) /* The %s will be one of 'struct', 'union', or 'enum'. */ - warning (0, "%<%s %E%> declared inside parameter list", - keyword, b->id); + warning_at (input_location, 0, + "%<%s %E%> declared inside parameter list" + " will not be visible outside of this definition or" + " declaration", keyword, b->id); else /* The %s will be one of 'struct', 'union', or 'enum'. */ - warning (0, "anonymous %s declared inside parameter list", - keyword); - - if (!explained_incomplete_types) - { - warning (0, "its scope is only this definition or declaration," - " which is probably not what you want"); - explained_incomplete_types = true; - } + warning_at (input_location, 0, + "anonymous %s declared inside parameter list" + " will not be visible outside of this definition or" + " declaration", keyword); } tag.id = b->id; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d809540..fcf7a54 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2015-07-28 Luis Felipe Strano Moraes <luis.strano@gmail.com> + Manuel López-Ibáñez <manu@gcc.gnu.org> + + * gcc.dg/parm-incomplete-1.c: Update. + * gcc.dg/pr18809-1.c: Update. + * gcc.dg/pr27953.c: Update. + * gcc.dg/vla-11.c: Update. + 2015-07-27 Marek Polacek <polacek@redhat.com> * c-c++-common/Wtautological-compare-2.c: Remove unused line. diff --git a/gcc/testsuite/gcc.dg/parm-incomplete-1.c b/gcc/testsuite/gcc.dg/parm-incomplete-1.c index 83dca82..02d97b9 100644 --- a/gcc/testsuite/gcc.dg/parm-incomplete-1.c +++ b/gcc/testsuite/gcc.dg/parm-incomplete-1.c @@ -17,7 +17,6 @@ struct s { int b; }; void h (struct s x) { } void j(struct t2); /* { dg-warning "'struct t2' declared inside parameter list" } */ -/* { dg-warning "its scope is only" "explanation" { target *-*-* } 19 } */ union u; diff --git a/gcc/testsuite/gcc.dg/pr18809-1.c b/gcc/testsuite/gcc.dg/pr18809-1.c index 3b6e8cc..a1f552b 100644 --- a/gcc/testsuite/gcc.dg/pr18809-1.c +++ b/gcc/testsuite/gcc.dg/pr18809-1.c @@ -5,6 +5,5 @@ void foo(enum E e) {} /* { dg-error "forward ref" "forward" } */ /* { dg-warning "declared" "declared" { target *-*-* } 6 } */ - /* { dg-warning "scope" "scope" { target *-*-* } 6 } */ /* { dg-error "incomplete" "incomplete" { target *-*-* } 6 } */ void bar() { foo(0); } diff --git a/gcc/testsuite/gcc.dg/pr27953.c b/gcc/testsuite/gcc.dg/pr27953.c index 8da92c1..d4d559e 100644 --- a/gcc/testsuite/gcc.dg/pr27953.c +++ b/gcc/testsuite/gcc.dg/pr27953.c @@ -1,7 +1,6 @@ /* PR c/27953 */ void foo(struct A a) {} /* { dg-warning "declared inside parameter list" "inside" } */ -/* { dg-warning "its scope is only" "scope" { target *-*-* } 3 } */ /* { dg-error "incomplete type" "incomplete" { target *-*-* } 3 } */ void foo() {} /* { dg-error "redefinition" "redef" } */ diff --git a/gcc/testsuite/gcc.dg/vla-11.c b/gcc/testsuite/gcc.dg/vla-11.c index 9c23e86..7db3442 100644 --- a/gcc/testsuite/gcc.dg/vla-11.c +++ b/gcc/testsuite/gcc.dg/vla-11.c @@ -10,4 +10,3 @@ void foo11a(int x[sizeof(int *(*)[*])]); /* { dg-warning "not in a declaration" void foo11b(__SIZE_TYPE__ x, int y[(__UINTPTR_TYPE__)(int (*)[*])x]); /* { dg-warning "not in a declaration" } */ void foo11c(struct s { int (*x)[*]; } *y); /* { dg-error "a member of a structure or union cannot have a variably modified type" "variably modified" } */ /* { dg-warning "'struct s' declared inside parameter list" "struct decl" { target *-*-* } 11 } */ -/* { dg-warning "its scope is only this definition or declaration" "struct scope" { target *-*-* } 11 } */ |