PR c++/42567
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 4 Jan 2010 17:53:29 +0000 (17:53 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 4 Jan 2010 17:53:29 +0000 (17:53 +0000)
* semantics.c (describable_type): Remove decltype comment and
semantics.

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

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

index af2d0c6..77dd1df 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 547e899..b2f9fd3 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 30b80af..8d559e9 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;
+  }
+};