summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-09 21:41:58 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-09 21:41:58 +0000
commitfe53a672833c5ae417902a5be37f1269a5387faf (patch)
treec9d38611b6899084054743883bcdac7c4b2b8b22 /gcc
parent26430bf5af459685c2544b0c254901f5de016ab0 (diff)
downloadgcc-fe53a672833c5ae417902a5be37f1269a5387faf.tar.gz
PR c++/37439
* pt.c (tsubst_copy) [PARM_DECL]: Don't abort if the parm has DECL_CONTEXT set. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140176 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/pt.c2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/auto6.C5
3 files changed, 11 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index be42b37cbfd..9760ccfca04 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2008-09-09 Jason Merrill <jason@redhat.com>
+
+ PR c++/37439
+ * pt.c (tsubst_copy) [PARM_DECL]: Don't abort if the parm has
+ DECL_CONTEXT set.
+
2008-09-09 Jakub Jelinek <jakub@redhat.com>
PR c++/37389
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 4aa7b1ad146..cdaae59914e 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -9809,7 +9809,7 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
Replace it with an arbitrary expression with the same type
(*(T*)0). This should only occur in an unevaluated context
(i.e. decltype). */
- gcc_assert (skip_evaluation && DECL_CONTEXT (t) == NULL_TREE);
+ gcc_assert (skip_evaluation);
r = non_reference (TREE_TYPE (t));
r = tsubst (r, args, complain, in_decl);
r = build_pointer_type (r);
diff --git a/gcc/testsuite/g++.dg/cpp0x/auto6.C b/gcc/testsuite/g++.dg/cpp0x/auto6.C
index a574f54758f..713583a1a48 100644
--- a/gcc/testsuite/g++.dg/cpp0x/auto6.C
+++ b/gcc/testsuite/g++.dg/cpp0x/auto6.C
@@ -6,7 +6,10 @@ auto f() -> int
}
template<class T, class U>
-auto add(T t, U u) -> decltype (t+u);
+auto add(T t, U u) -> decltype (t+u)
+{
+ return t+u;
+}
template<class T, class U>
decltype(T()+U()) add2(T t, U u);