aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2010-04-14 16:17:34 -0400
committerJason Merrill <jason@gcc.gnu.org>2010-04-14 16:17:34 -0400
commit943f82e7681224a36aadf743b6572ef55ec9e7ec (patch)
tree15fb63d52eb5842deac30924073c0b3cdfc5783f /gcc/c-common.c
parent17fb1a8ce7ef03fcd293c16fc2e5bf087b165802 (diff)
downloadgcc-943f82e7681224a36aadf743b6572ef55ec9e7ec.zip
gcc-943f82e7681224a36aadf743b6572ef55ec9e7ec.tar.gz
gcc-943f82e7681224a36aadf743b6572ef55ec9e7ec.tar.bz2
re PR c++/36625 (bogus error on __attribute__((aligned(N))) in template code)
PR c++/36625 * c-common.c (attribute_takes_identifier_p): New fn. * c-common.h: Declare it. cp/ * parser.c (cp_parser_parenthesized_expression_list): Change is_attribute_list parm to int to indicate whether or not to handle initial identifier specially. (cp_parser_attribute_list): Use attribute_takes_identifier_p. From-SVN: r158355
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 0669ba0..ac11367 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -5809,6 +5809,17 @@ c_init_attributes (void)
#undef DEF_ATTR_TREE_LIST
}
+/* Returns TRUE iff the attribute indicated by ATTR_ID takes a plain
+ identifier as an argument, so the front end shouldn't look it up. */
+
+bool
+attribute_takes_identifier_p (tree attr_id)
+{
+ return (is_attribute_p ("mode", attr_id)
+ || is_attribute_p ("format", attr_id)
+ || is_attribute_p ("cleanup", attr_id));
+}
+
/* Attribute handlers common to C front ends. */
/* Handle a "packed" attribute; arguments as in