]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR c++/64251
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 18 Dec 2014 22:22:36 +0000 (22:22 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 18 Dec 2014 22:22:36 +0000 (22:22 +0000)
* decl2.c (mark_used): Don't mark if in_template_function.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218876 138bc75d-0d04-0410-961f-82ee72b054a4

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);
+}