re PR c++/64251 (Chromium build error only with --enable-checking=yes)
authorJason Merrill <jason@redhat.com>
Thu, 18 Dec 2014 22:22:36 +0000 (17:22 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 18 Dec 2014 22:22:36 +0000 (17:22 -0500)
PR c++/64251
* decl2.c (mark_used): Don't mark if in_template_function.

From-SVN: r218876

gcc/cp/ChangeLog
gcc/cp/decl2.c
gcc/testsuite/g++.dg/template/non-dependent14.C [new file with mode: 0644]

index e22b516ae7509a92126159b22d819396f78477b5..80892b600836a3bb5bffaa1ca5b52dde56421709 100644 (file)
@@ -1,3 +1,8 @@
+2014-12-18  Jason Merrill  <jason@redhat.com>
+
+       PR c++/64251
+       * decl2.c (mark_used): Don't mark if in_template_function.
+
 2014-12-18  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/60955
index b2123f2decb47a437bde8c67ebdc718dc14e4ffa..69201b0ba981c8592b3dd8c014f86b09d0d04e2f 100644 (file)
@@ -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 (file)
index 0000000..b257d9b
--- /dev/null
@@ -0,0 +1,7 @@
+// PR c++/64251
+
+class DictionaryValue {};
+template <typename T> void CreateValue(T) {
+  DictionaryValue(0);
+  CreateValue(0);
+}