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] [PR c++/88146] do not crash synthesizing inherited ctor(...)


On Sat, Dec 29, 2018 at 12:33:18AM -0200, Alexandre Oliva wrote:
> --- a/gcc/cp/typeck2.c
> +++ b/gcc/cp/typeck2.c
> @@ -918,7 +918,11 @@ check_narrowing (tree type, tree init, tsubst_flags_t complain, bool const_only)
>        return ok;
>      }
>  
> -  init = maybe_constant_value (init);
> +  /* Immediate subexpressions in BRACED_ENCLOSED_INITIALIZERs are
> +     potentially constant evaluated.  Without manifestly_const_eval,

The term in latest draft is manifestly constant-evaluated.

> +     we won't instantiate constexpr functions that we must
> +     instantiate.  */
> +  init = maybe_constant_value (init, NULL_TREE, /*manifestly_const_eval=*/true);

If this is a right change, then it should be covered also by a testcase that
makes sure __builtin_is_constant_evaluated () in those initializers
evaluates to true in a new g++.dg/cpp2a/is-constant-evaluated-*.C testcase.

	Jakub


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