PR c++/37439
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 9 Sep 2008 21:41:58 +0000 (21:41 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 9 Sep 2008 21:41:58 +0000 (21:41 +0000)
        * 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

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/g++.dg/cpp0x/auto6.C

index be42b37..9760ccf 100644 (file)
@@ -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
index 4aa7b1a..cdaae59 100644 (file)
@@ -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);
index a574f54..713583a 100644 (file)
@@ -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);