From 4b4a42c40af8376511de3b797c3d75a34f09b925 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Mon, 4 Jan 2010 12:53:29 -0500 Subject: [PATCH] re PR c++/42567 ([C++0x] ICE with auto in type_unification_real, at cp/pt.c:13310) PR c++/42567 * semantics.c (describable_type): Remove decltype comment and semantics. From-SVN: r155627 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/semantics.c | 9 +++------ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp0x/auto17.C | 10 ++++++++++ 4 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp0x/auto17.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index af2d0c6d653..77dd1df6954 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2010-01-04 Jason Merrill + + PR c++/42567 + * semantics.c (describable_type): Remove decltype comment and + semantics. + Copyright (C) 2010 Free Software Foundation, Inc. diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 547e89934c1..b2f9fd31f56 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -4690,10 +4690,8 @@ finish_static_assert (tree condition, tree message, location_t location, } } -/* 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: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 30b80afd82e..8d559e91c3b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-01-04 Jason Merrill + + PR c++/42567 + * g++.dg/cpp0x/auto17.C: New. + 2010-01-04 Rafael Avila de Espindola * 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 index 00000000000..03608d33ac6 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/auto17.C @@ -0,0 +1,10 @@ +// PR c++/42567 +// { dg-options "-std=c++0x" } + +template +struct A { + template + void fn(C c) { + auto& key = *c; + } +}; -- 2.11.4.GIT