]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/50870 ([C++0x] [4.6/4.7 Regression] ICE with decltype, operator->, and...
authorJason Merrill <jason@redhat.com>
Tue, 8 Nov 2011 00:46:06 +0000 (19:46 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 8 Nov 2011 00:46:06 +0000 (19:46 -0500)
PR c++/50870
* pt.c (tsubst_copy): Handle NAMESPACE_DECL.
(tsubst_copy_and_build) [COMPONENT_REF]: Handle a still-dependent
object.

From-SVN: r181140

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/decltype35.C [new file with mode: 0644]

index 729462609d240f9769cda660161e8a69df3c84dc..58a51fd1e4992665c523204460f3219162607afe 100644 (file)
@@ -1,3 +1,10 @@
+2011-11-07  Jason Merrill  <jason@redhat.com>
+
+       PR c++/50870
+       * pt.c (tsubst_copy): Handle NAMESPACE_DECL.
+       (tsubst_copy_and_build) [COMPONENT_REF]: Handle a still-dependent
+       object.
+
 2011-11-04  Eric Botcazou  <ebotcazou@adacore.com>
 
        PR c++/50608
index bfe598001abea3938fe7f6298feeadf3e3440fdc..9577bd8f6c6941c143288d9969136cbb2fbdf952 100644 (file)
@@ -11439,6 +11439,9 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
       mark_used (t);
       return t;
 
+    case NAMESPACE_DECL:
+      return t;
+
     case OVERLOAD:
       /* An OVERLOAD will always be a non-dependent overload set; an
         overload set from function scope will just be represented with an
@@ -13179,7 +13182,9 @@ tsubst_copy_and_build (tree t,
        if (member == error_mark_node)
          return error_mark_node;
 
-       if (object_type && !CLASS_TYPE_P (object_type))
+       if (type_dependent_expression_p (object))
+         /* We can't do much here.  */;
+       else if (!CLASS_TYPE_P (object_type))
          {
            if (SCALAR_TYPE_P (object_type))
              {
index ac5c6231b35ea524d3353e6b60abe77fd9d06e90..3951c6633eb9260980c99af15a02974cadc5d253 100644 (file)
@@ -1,3 +1,8 @@
+2011-11-07  Jason Merrill  <jason@redhat.com>
+
+       PR c++/50870
+       * g++.dg/cpp0x/decltype35.C: New.
+
 2011-11-04  Eric Botcazou  <ebotcazou@adacore.com>
 
        * g++.dg/other/offsetof7.C: New test.
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype35.C b/gcc/testsuite/g++.dg/cpp0x/decltype35.C
new file mode 100644 (file)
index 0000000..d1fd476
--- /dev/null
@@ -0,0 +1,15 @@
+// PR c++/50870
+// { dg-options -std=c++0x }
+
+template <class V>
+  struct impl
+  {
+    template <class T> static T create();
+  };
+
+template <class T, class U, class V, class
+      = decltype(impl<V>::template create<T>()
+             -> impl<V>::template create<U>())>
+struct tester { };
+
+tester<impl<float>*, int, float> ti;