]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
compiler: Fix struct inheriting interface with varargs method.
authorIan Lance Taylor <ian@gcc.gnu.org>
Wed, 7 Mar 2012 16:06:10 +0000 (16:06 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Wed, 7 Mar 2012 16:06:10 +0000 (16:06 +0000)
From-SVN: r185060

gcc/go/gofrontend/types.cc

index 3c33a6dcd49bf06603da9c87a6478a15e169ebdf..d3a75f425d148bbd1c75cfd26bdbf03abd6a74c9 100644 (file)
@@ -3744,8 +3744,12 @@ Function_type::copy_with_receiver(Type* receiver_type) const
   go_assert(!this->is_method());
   Typed_identifier* receiver = new Typed_identifier("", receiver_type,
                                                    this->location_);
-  return Type::make_function_type(receiver, this->parameters_,
-                                 this->results_, this->location_);
+  Function_type* ret = Type::make_function_type(receiver, this->parameters_,
+                                               this->results_,
+                                               this->location_);
+  if (this->is_varargs_)
+    ret->set_is_varargs();
+  return ret;
 }
 
 // Make a function type.