]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/42567 ([C++0x] ICE with auto in type_unification_real, at cp/pt.c:13310)
authorJason Merrill <jason@redhat.com>
Mon, 4 Jan 2010 17:53:29 +0000 (12:53 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 4 Jan 2010 17:53:29 +0000 (12:53 -0500)
PR c++/42567
* semantics.c (describable_type): Remove decltype comment and
semantics.

From-SVN: r155627

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

index af2d0c6d653b5126a583fc911208b7ac1b4416d0..77dd1df69540f152beb01f8c400c47f63e49538f 100644 (file)
@@ -1,3 +1,9 @@
+2010-01-04  Jason Merrill  <jason@redhat.com>
+
+       PR c++/42567
+       * semantics.c (describable_type): Remove decltype comment and
+       semantics.
+
 
 \f
 Copyright (C) 2010 Free Software Foundation, Inc.
index 547e89934c1c659e74cd0b97e5d6a947881fcbfe..b2f9fd31f56403dfcf4958542ed83a44506cafc1 100644 (file)
@@ -4690,10 +4690,8 @@ finish_static_assert (tree condition, tree message, location_t location,
     }
 }
 \f
-/* Returns decltype((EXPR)) for cases where we can drop the decltype and
-   just return the type even though EXPR is a type-dependent expression.
-   The ABI specifies which cases this applies to, which is a subset of the
-   possible cases.  */
+/* Returns the type of EXPR for cases where we can determine it even though
+   EXPR is a type-dependent expression.  */
 
 tree
 describable_type (tree expr)
@@ -4717,8 +4715,7 @@ describable_type (tree expr)
     case PARM_DECL:
     case RESULT_DECL:
     case FUNCTION_DECL:
-      /* Named rvalue reference becomes lvalue.  */
-      type = build_reference_type (non_reference (TREE_TYPE (expr)));
+      return TREE_TYPE (expr);
       break;
 
     case NEW_EXPR:
index 30b80afd82e37339a4b4b0b70ab0fb3dcad8f052..8d559e91c3b236d4c5ec8a2a4bf0019d8ff2ad20 100644 (file)
@@ -1,3 +1,8 @@
+2010-01-04  Jason Merrill  <jason@redhat.com>
+
+       PR c++/42567
+       * g++.dg/cpp0x/auto17.C: New.
+
 2010-01-04  Rafael Avila de Espindola  <espindola@google.com>
 
        * gcc.dg/lto/20100104_0.c: New.
diff --git a/gcc/testsuite/g++.dg/cpp0x/auto17.C b/gcc/testsuite/g++.dg/cpp0x/auto17.C
new file mode 100644 (file)
index 0000000..03608d3
--- /dev/null
@@ -0,0 +1,10 @@
+// PR c++/42567
+// { dg-options "-std=c++0x" }
+
+template<typename B>
+struct A {
+  template<typename C>
+  void fn(C c) {
+    auto& key = *c;
+  }
+};