diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2008-05-23 10:36:37 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2008-05-23 10:36:37 +0000 |
commit | 3fda325236b11bff7210616f03247012d393a95f (patch) | |
tree | 0f676e3f2721b636c20fb5b3d5e4f9c332544585 /gcc/ada/utils.c | |
parent | 19f6f5a42c8522e8df729109d5fff21e520fc439 (diff) | |
download | gcc-3fda325236b11bff7210616f03247012d393a95f.zip gcc-3fda325236b11bff7210616f03247012d393a95f.tar.gz gcc-3fda325236b11bff7210616f03247012d393a95f.tar.bz2 |
utils.c (handle_type_generic_attribute): Adjust to accept fixed arguments before an elipsis.
* utils.c (handle_type_generic_attribute): Adjust to accept
fixed arguments before an elipsis.
From-SVN: r135797
Diffstat (limited to 'gcc/ada/utils.c')
-rw-r--r-- | gcc/ada/utils.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c index b4b3894..7a984b2 100644 --- a/gcc/ada/utils.c +++ b/gcc/ada/utils.c @@ -4712,8 +4712,17 @@ handle_type_generic_attribute (tree *node, tree ARG_UNUSED (name), tree ARG_UNUSED (args), int ARG_UNUSED (flags), bool * ARG_UNUSED (no_add_attrs)) { - /* Ensure we have a function type, with no arguments. */ - gcc_assert (TREE_CODE (*node) == FUNCTION_TYPE && ! TYPE_ARG_TYPES (*node)); + tree params; + + /* Ensure we have a function type. */ + gcc_assert (TREE_CODE (*node) == FUNCTION_TYPE); + + params = TYPE_ARG_TYPES (*node); + while (params && ! VOID_TYPE_P (TREE_VALUE (params))) + params = TREE_CHAIN (params); + + /* Ensure we have a variadic function. */ + gcc_assert (!params); return NULL_TREE; } |