Commit 1b9b91a6 by Jason Merrill Committed by Jason Merrill

re PR c++/46803 (libstdc++ build errors on invalid OpenBSD system header attributes)

	PR c++/46803
	* c-common.c (attribute_takes_identifier_p): Assume that an
	unknown attribute takes an identifier.

From-SVN: r170885
parent 6a4e2bd5
2011-03-11 Jason Merrill <jason@redhat.com>
PR c++/46803
* c-common.c (attribute_takes_identifier_p): Assume that an
unknown attribute takes an identifier.
2011-03-07 Nathan Froyd <froydnj@codesourcery.com> 2011-03-07 Nathan Froyd <froydnj@codesourcery.com>
PR c/47786 PR c/47786
......
...@@ -5665,9 +5665,14 @@ c_init_attributes (void) ...@@ -5665,9 +5665,14 @@ c_init_attributes (void)
bool bool
attribute_takes_identifier_p (const_tree attr_id) attribute_takes_identifier_p (const_tree attr_id)
{ {
if (is_attribute_p ("mode", attr_id) struct attribute_spec *spec = lookup_attribute_spec (attr_id);
|| is_attribute_p ("format", attr_id) if (spec == NULL)
|| is_attribute_p ("cleanup", attr_id)) /* Unknown attribute that we'll end up ignoring, return true so we
don't complain about an identifier argument. */
return true;
else if (!strcmp ("mode", spec->name)
|| !strcmp ("format", spec->name)
|| !strcmp ("cleanup", spec->name))
return true; return true;
else else
return targetm.attribute_takes_identifier_p (attr_id); return targetm.attribute_takes_identifier_p (attr_id);
......
2011-03-11 Jason Merrill <jason@redhat.com> 2011-03-11 Jason Merrill <jason@redhat.com>
* g++.dg/ext/attrib40.C: New.
* g++.dg/cpp0x/regress/array1.C: New. * g++.dg/cpp0x/regress/array1.C: New.
2011-03-11 Richard Guenther <rguenther@suse.de> 2011-03-11 Richard Guenther <rguenther@suse.de>
......
// PR c++/46803
int strftime(char *, int, const char *, const struct tm *)
__attribute__ ((__bounded__(__string__,1,2))); // { dg-warning "ignored" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment