]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/40381 (Revision 142379 caused ICE with deleted functions)
authorJason Merrill <jason@redhat.com>
Tue, 9 Jun 2009 18:18:45 +0000 (14:18 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 9 Jun 2009 18:18:45 +0000 (14:18 -0400)
PR c++/40381
* decl2.c (mark_used): Return after complaining about deleted fn.

From-SVN: r148319

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

index c4e84aa14b8e00cdac97eba3c455081ef78877a5..76f83c60a53599a7f206758d1f6e6eb3c901cc38 100644 (file)
@@ -1,3 +1,8 @@
+2009-06-09  Jason Merrill  <jason@redhat.com>
+
+       PR c++/40381
+       * decl2.c (mark_used): Return after complaining about deleted fn.
+
 2009-06-08  Jason Merrill  <jason@redhat.com>
 
        * parser.c (cp_parser_type_id_1): 'auto' type is ok with a
index d368ea803bba78f4ba9d600032843e3c1076ad62..b4f4404d1edbb2750b5014579a750774aa7e5eca 100644 (file)
@@ -3809,6 +3809,7 @@ mark_used (tree decl)
     {
       error ("deleted function %q+D", decl);
       error ("used here");
+      return;
     }
   /* If we don't need a value, then we don't need to synthesize DECL.  */
   if (skip_evaluation)
index 8ecbde7ad3a12656d66c61427d20b53303d51d10..1d5b50a59d5ad4d2a9a414a004c024b6e0073bf8 100644 (file)
@@ -1,3 +1,7 @@
+2009-06-09  Jason Merrill  <jason@redhat.com>
+
+       * g++.dg/cpp0x/defaulted10.C: New.
+
 2009-06-09  Martin Jambor  <mjambor@suse.cz>
 
        * testsuite/gcc.c-torture/compile/pr40351.c: New file.
diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted10.C b/gcc/testsuite/g++.dg/cpp0x/defaulted10.C
new file mode 100644 (file)
index 0000000..d169e0c
--- /dev/null
@@ -0,0 +1,14 @@
+// PR c++/40381
+// { dg-options "-std=gnu++0x" }
+
+struct A
+{
+  template<typename T> void foo(T) = delete; // { dg-error "previously|deleted" }
+};
+
+template<typename T> void A::foo(T) {} // { dg-error "redefinition" }
+
+void bar()
+{
+  A().foo(0);                  // { dg-error "used" }
+}