re PR middle-end/56167 (ICE with invalid __attribute__ arguments)

PR middle-end/56167
	* c-common.c (handle_error_attribute): Fix condition.

	* gcc.dg/pr56167.c: New test.

From-SVN: r195748
This commit is contained in:
Jakub Jelinek 2013-02-05 09:08:27 +01:00 committed by Jakub Jelinek
parent ea99f6314d
commit cf35e2b1e6
4 changed files with 26 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2013-02-05 Jakub Jelinek <jakub@redhat.com>
PR middle-end/56167
* c-common.c (handle_error_attribute): Fix condition.
2013-01-30 Jakub Jelinek <jakub@redhat.com>
PR c++/55742

View File

@ -6678,7 +6678,7 @@ handle_error_attribute (tree *node, tree name, tree args,
int ARG_UNUSED (flags), bool *no_add_attrs)
{
if (TREE_CODE (*node) == FUNCTION_DECL
|| TREE_CODE (TREE_VALUE (args)) == STRING_CST)
&& TREE_CODE (TREE_VALUE (args)) == STRING_CST)
/* Do nothing else, just set the attribute. We'll get at
it later with lookup_attribute. */
;

View File

@ -1,3 +1,8 @@
2013-02-05 Jakub Jelinek <jakub@redhat.com>
PR middle-end/56167
* gcc.dg/pr56167.c: New test.
2013-02-04 Oleg Endo <olegendo@gcc.gnu.org>
PR target/55146

View File

@ -0,0 +1,15 @@
/* PR middle-end/56167 */
/* { dg-do compile } */
extern void foo (void) __attribute__ ((error (0))); /* { dg-warning "attribute ignored" } */
extern void bar (void) __attribute__ ((warning (0))); /* { dg-warning "attribute ignored" } */
int var __attribute__ ((error ("foo"))); /* { dg-warning "attribute ignored" } */
int
main ()
{
foo ();
bar ();
var++;
return 0;
}