mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-10 09:20:31 +08:00
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:
parent
74687efe94
commit
533007c1e9
@ -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
|
||||
|
@ -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)))
|
||||
|
12
gcc/testsuite/g++.dg/ext/tmplattr6.C
Normal file
12
gcc/testsuite/g++.dg/ext/tmplattr6.C
Normal 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>();
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user