From: Jason Merrill Date: Fri, 18 Mar 2011 20:23:48 +0000 (-0400) Subject: c.opt (fconstexpr-depth): Add Var(max_constexpr_depth). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=49a000c39629e84c69696bfc78fb9e3f5c3dd594;p=gcc.git c.opt (fconstexpr-depth): Add Var(max_constexpr_depth). * c.opt (fconstexpr-depth): Add Var(max_constexpr_depth). * c-common.h: Don't declare it here. * c-common.c: Or define it here. * c-opts.c (c_common_handle_option): Or set it here. From-SVN: r171166 --- diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index ca3db25b1cb..a97a04eb287 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,5 +1,10 @@ 2011-03-18 Jason Merrill + * c.opt (fconstexpr-depth): Add Var(max_constexpr_depth). + * c-common.h: Don't declare it here. + * c-common.c: Or define it here. + * c-opts.c (c_common_handle_option): Or set it here. + PR c++/35315 * c-common.c (handle_transparent_union_attribute): Don't make a duplicate type in C++. diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 799f8154936..f8d0c7e1074 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -260,11 +260,6 @@ enum cxx_dialect cxx_dialect = cxx98; int max_tinst_depth = 1024; -/* Likewise, for constexpr function call evaluations. N3225 specifies a - minimum of 512. */ - -int max_constexpr_depth = 512; - /* The elements of `ridpointers' are identifier nodes for the reserved type names and storage classes. It is indexed by a RID_... value. */ tree *ridpointers; diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h index b6fcee9e2d6..6046d3e4fbe 100644 --- a/gcc/c-family/c-common.h +++ b/gcc/c-family/c-common.h @@ -623,10 +623,6 @@ extern enum cxx_dialect cxx_dialect; extern int max_tinst_depth; -/* Likewise, for constexpr function call evaluations. */ - -extern int max_constexpr_depth; - /* Nonzero means that we should not issue warnings about problems that occur when the code is executed, because the code being processed is not expected to be executed. This is set during parsing. This diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c index 8d2a08bad9f..8d6e6e7e243 100644 --- a/gcc/c-family/c-opts.c +++ b/gcc/c-family/c-opts.c @@ -568,10 +568,6 @@ c_common_handle_option (size_t scode, const char *arg, int value, disable_builtin_function (arg); break; - case OPT_fconstexpr_depth_: - max_constexpr_depth = value; - break; - case OPT_fdirectives_only: cpp_opts->directives_only = value; break; diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index f791190f9e8..0061ec57f52 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -720,8 +720,8 @@ ObjC ObjC++ Joined MissingArgError(no class name specified with %qs) -fconst-string-class= Use class for constant strings fconstexpr-depth= -C++ ObjC++ Joined RejectNegative UInteger --constexpr-depth= Specify maximum constexpr recursion depth +C++ ObjC++ Joined RejectNegative UInteger Var(max_constexpr_depth) Init(512) +-fconstexpr-depth= Specify maximum constexpr recursion depth fdeduce-init-list C++ ObjC++ Var(flag_deduce_init_list) Init(1)