]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR c++/61433
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Jun 2014 21:38:24 +0000 (21:38 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Jun 2014 21:38:24 +0000 (21:38 +0000)
* error.c (dump_template_bindings): Don't tsubst in a clone.

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

gcc/cp/ChangeLog
gcc/cp/error.c
gcc/testsuite/g++.dg/debug/dwarf2/pr61433.C [new file with mode: 0644]

index 90ec8ad008bee24998b058e490b47dc2b4fba89c..2236a5c948a427255943994c5dd5c0f6114db8e8 100644 (file)
@@ -1,3 +1,8 @@
+2014-06-27  Jason Merrill  <jason@redhat.com>
+
+       PR c++/61433
+       * error.c (dump_template_bindings): Don't tsubst in a clone.
+
 2014-06-27  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/61614
index 27a167a001a839ec02e1558ea55d604f8ad8746f..fa3bdc4f6a587af7c33d8d5c52efc13048deb36e 100644 (file)
@@ -318,6 +318,11 @@ dump_template_bindings (cxx_pretty_printer *pp, tree parms, tree args,
   if (vec_safe_is_empty (typenames) || uses_template_parms (args))
     return;
 
+  /* Don't try to print typenames when we're processing a clone.  */
+  if (current_function_decl
+      && !DECL_LANG_SPECIFIC (current_function_decl))
+    return;
+
   FOR_EACH_VEC_SAFE_ELT (typenames, i, t)
     {
       if (need_semicolon)
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/pr61433.C b/gcc/testsuite/g++.dg/debug/dwarf2/pr61433.C
new file mode 100644 (file)
index 0000000..a63b8a9
--- /dev/null
@@ -0,0 +1,23 @@
+// PR c++/61433
+// { dg-do compile { target c++11 } }
+// { dg-options "-O -fcompare-debug -fno-inline -fno-ipa-pure-const -fipa-sra" }
+
+template <class T>
+struct A
+{
+  template <class V>
+  struct B
+  {
+    int MEM;
+  };
+};
+struct D {};
+struct C: public A<int>::B<D>
+{};
+template <class T, class U, class V>
+auto k(T t, U u, V v) -> decltype (t.U::template B<V>::MEM)
+{}
+int main()
+{
+  k( C(), A<int>(), D() );
+}