From 49a000c39629e84c69696bfc78fb9e3f5c3dd594 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Fri, 18 Mar 2011 16:23:48 -0400 Subject: [PATCH] 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 --- gcc/c-family/ChangeLog | 5 +++++ gcc/c-family/c-common.c | 5 ----- gcc/c-family/c-common.h | 4 ---- gcc/c-family/c-opts.c | 4 ---- gcc/c-family/c.opt | 4 ++-- 5 files changed, 7 insertions(+), 15 deletions(-) diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index ca3db25..a97a04e 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 799f815..f8d0c7e 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 b6fcee9..6046d3e 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 8d2a08b..8d6e6e7 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 f791190..0061ec5 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) -- 2.7.4