OSDN Git Service

2008-05-27 Thomas Quinot <quinot@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / utils.c
index b4b3894..8dd445f 100644 (file)
@@ -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;
 }
@@ -4754,8 +4763,8 @@ def_builtin_1 (enum built_in_function fncode,
   if (both_p)
     /* ??? This is normally further controlled by command-line options
        like -fno-builtin, but we don't have them for Ada.  */
-      add_builtin_function (libname, libtype, fncode, fnclass,
-                           NULL, fnattrs);
+    add_builtin_function (libname, libtype, fncode, fnclass,
+                         NULL, fnattrs);
 
   built_in_decls[(int) fncode] = decl;
   if (implicit_p)