diff mbox series

c++: Fix cp_build_function_call_vec [PR 98626]

Message ID 12586ae7-0126-bb13-01cd-5d57977e101f@acm.org
State New
Headers show
Series c++: Fix cp_build_function_call_vec [PR 98626] | expand

Commit Message

Nathan Sidwell Jan. 13, 2021, 1:16 p.m. UTC
I misunderstood the cp_build_function_call_vec API, thinking a NULL
vector was an acceptable way of passing no arguments.  You need to
pass a vector of no elements.

         PR c++/98626
         gcc/cp/
         * module.cc (module_add_import_initializers):  Pass a
         zero-element argument vector.
diff mbox series

Patch

diff --git c/gcc/cp/module.cc w/gcc/cp/module.cc
index d2093916c9e..1fd0bcfe3eb 100644
--- c/gcc/cp/module.cc
+++ w/gcc/cp/module.cc
@@ -18977,8 +18977,8 @@  module_add_import_initializers ()
   if (modules)
     {
       tree fntype = build_function_type (void_type_node, void_list_node);
-      vec<tree, va_gc> *args = NULL;
-      
+      releasing_vec args;  // There are no args
+
       for (unsigned ix = modules->length (); --ix;)
 	{
 	  module_state *import = (*modules)[ix];