diff options
author | Jason Merrill <jason@redhat.com> | 2011-07-16 00:11:53 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-07-16 00:11:53 -0400 |
commit | b6c917ff5dbdbbf3547d7198eff249936f7011fa (patch) | |
tree | be316d2adfde34ba7f9bc197ea6bd6f4528452f0 /gcc/cp/decl2.c | |
parent | ea6136a283596a40c177cf79e01c204cc2fc555e (diff) | |
download | gcc-b6c917ff5dbdbbf3547d7198eff249936f7011fa.zip gcc-b6c917ff5dbdbbf3547d7198eff249936f7011fa.tar.gz gcc-b6c917ff5dbdbbf3547d7198eff249936f7011fa.tar.bz2 |
Make-lang.in (check-g++-strict-gc): New.
* Make-lang.in (check-g++-strict-gc): New.
(cp/except.o): Depend on gt-cp-except.h
* except.c: Include gt-cp-except.h.
* config-lang.in (gtfiles): Add cp/except.c.
* decl2.c (mark_used): Adjust constexpr condition, set
function_depth around template instantiation.
* parser.c (cp_parser_lambda_body): Set function_depth.
* semantics.c (maybe_add_lambda_conv_op): Likewise.
From-SVN: r176350
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r-- | gcc/cp/decl2.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index e1f9562..f05b0f8 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -4231,9 +4231,9 @@ mark_used (tree decl) if ((decl_maybe_constant_var_p (decl) || (TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_CONSTEXPR_P (decl))) - && !DECL_INITIAL (decl) && DECL_LANG_SPECIFIC (decl) - && DECL_TEMPLATE_INSTANTIATION (decl)) + && DECL_TEMPLATE_INFO (decl) + && !uses_template_parms (DECL_TI_ARGS (decl))) { /* Instantiating a function will result in garbage collection. We must treat this situation as if we were within the body of a @@ -4327,8 +4327,12 @@ mark_used (tree decl) times. Maintaining a stack of active functions is expensive, and the inliner knows to instantiate any functions it might need. Therefore, we always try to defer instantiation. */ - instantiate_decl (decl, /*defer_ok=*/true, - /*expl_inst_class_mem_p=*/false); + { + ++function_depth; + instantiate_decl (decl, /*defer_ok=*/true, + /*expl_inst_class_mem_p=*/false); + --function_depth; + } } #include "gt-cp-decl2.h" |