decl2.c (is_late_template_attribute): Don't crash on unknown attribute.

* decl2.c (is_late_template_attribute): Don't crash on unknown
        attribute.

From-SVN: r128844
This commit is contained in:
Jason Merrill 2007-09-27 14:54:06 -04:00 committed by Jason Merrill
parent 74687efe94
commit 533007c1e9
3 changed files with 21 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2007-09-27 Jason Merrill <jason@redhat.com>
* decl2.c (is_late_template_attribute): Don't crash on unknown
attribute.
2007-09-27 Paolo Carlini <pcarlini@suse.de>
PR c++/33493

View File

@ -986,6 +986,10 @@ is_late_template_attribute (tree attr, tree decl)
tree args = TREE_VALUE (attr);
const struct attribute_spec *spec = lookup_attribute_spec (name);
if (!spec)
/* Unknown attribute. */
return false;
if (is_attribute_p ("aligned", name)
&& args
&& value_dependent_expression_p (TREE_VALUE (args)))

View File

@ -0,0 +1,12 @@
// Don't crash on an unknown attribute.
struct foo {
template <class T>
void __attribute__((leafify)) bar() {} // { dg-warning "ignored" }
};
void bar(void)
{
foo f;
f.bar<int>();
}