]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/37288 (ICE using auto as function return type or parameter)
authorJason Merrill <jason@redhat.com>
Sat, 30 Aug 2008 23:12:45 +0000 (19:12 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Sat, 30 Aug 2008 23:12:45 +0000 (19:12 -0400)
        PR c++/37288
        * pt.c (dependent_type_p): Don't abort on auto outside of a template.

From-SVN: r139811

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

index debbaba4661655714c68e18adaab68bdd80be8f8..7802e7eacdb2062fcdfe16efee3f23bbed6f4c34 100644 (file)
@@ -1,3 +1,8 @@
+2008-08-30  Jason Merrill  <jason@redhat.com>
+
+       PR c++/37288
+       * pt.c (dependent_type_p): Don't abort on auto outside of a template.
+
 2008-08-29  Jason Merrill  <jason@redhat.com>
 
        Implement C++0x 'auto' semantics.
index 3b345f1f4a36930c57bafba2b8292682e1321a0a..5bb18d99e88591e5140247a8cc09a3ca0e109827 100644 (file)
@@ -15892,7 +15892,7 @@ dependent_type_p (tree type)
       /* If we are not processing a template, then nobody should be
         providing us with a dependent type.  */
       gcc_assert (type);
-      gcc_assert (TREE_CODE (type) != TEMPLATE_TYPE_PARM);
+      gcc_assert (TREE_CODE (type) != TEMPLATE_TYPE_PARM || is_auto (type));
       return false;
     }
 
index c16ed7b65d18317a3a0c66b980eeee19041cd3ec..dc4218bf023456924e8874d380f3ea0dc7e6b043 100644 (file)
@@ -14,3 +14,10 @@ struct A { };
 A<int> A1;
 // CWG issue 625
 A<auto> A2 = A1;               // { dg-error "auto" }
+
+auto foo() { }                 // { dg-error "auto" }
+
+void bar(auto i)               // { dg-error "incomplete|auto" }
+{
+  (void)i;
+}