From 1b82e09e18d5c5f1e73b457864f1a310fcfb3f77 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Thu, 18 Dec 2014 17:22:36 -0500 Subject: [PATCH] re PR c++/64251 (Chromium build error only with --enable-checking=yes) PR c++/64251 * decl2.c (mark_used): Don't mark if in_template_function. From-SVN: r218876 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/decl2.c | 2 +- gcc/testsuite/g++.dg/template/non-dependent14.C | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/template/non-dependent14.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e22b516ae75..80892b60083 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2014-12-18 Jason Merrill + + PR c++/64251 + * decl2.c (mark_used): Don't mark if in_template_function. + 2014-12-18 Paolo Carlini PR c++/60955 diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index b2123f2decb..69201b0ba98 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -5017,7 +5017,7 @@ mark_used (tree decl, tsubst_flags_t complain) --function_depth; } - if (processing_template_decl) + if (processing_template_decl || in_template_function ()) return true; /* Check this too in case we're within instantiate_non_dependent_expr. */ diff --git a/gcc/testsuite/g++.dg/template/non-dependent14.C b/gcc/testsuite/g++.dg/template/non-dependent14.C new file mode 100644 index 00000000000..b257d9baf1a --- /dev/null +++ b/gcc/testsuite/g++.dg/template/non-dependent14.C @@ -0,0 +1,7 @@ +// PR c++/64251 + +class DictionaryValue {}; +template void CreateValue(T) { + DictionaryValue(0); + CreateValue(0); +} -- 2.30.2