This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ PATCH to implement P1064R0, Virtual Function Calls in Constant Expressions (v4)


On Sep 19 2018, Marek Polacek <polacek@redhat.com> wrote:

> 2018-09-19  Marek Polacek  <polacek@redhat.com>
>
> 	* class.c (build_vtbl_initializer): Don't mess with *inits for
> 	TARGET_VTABLE_USES_DESCRIPTORS.
>
> diff --git gcc/cp/class.c gcc/cp/class.c
> index 9ca46441871..0239f6ae045 100644
> --- gcc/cp/class.c
> +++ gcc/cp/class.c
> @@ -9370,7 +9370,7 @@ build_vtbl_initializer (tree binfo,
>  	  int i;
>  	  if (init == size_zero_node)
>  	    for (i = 0; i < TARGET_VTABLE_USES_DESCRIPTORS; ++i)
> -	      CONSTRUCTOR_APPEND_ELT (*inits, idx, init);
> +	      CONSTRUCTOR_APPEND_ELT (*inits, NULL_TREE, init);
>  	  else
>  	    for (i = 0; i < TARGET_VTABLE_USES_DESCRIPTORS; ++i)
>  	      {
> @@ -9378,7 +9378,7 @@ build_vtbl_initializer (tree binfo,
>  				     fn, build_int_cst (NULL_TREE, i));
>  		TREE_CONSTANT (fdesc) = 1;
>  
> -		CONSTRUCTOR_APPEND_ELT (*inits, idx, fdesc);
> +		CONSTRUCTOR_APPEND_ELT (*inits, NULL_TREE, fdesc);
>  	      }
>  	}
>        else

Thanks, that works.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]