]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR c++/38649
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 11 Feb 2009 05:23:38 +0000 (05:23 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 11 Feb 2009 05:23:38 +0000 (05:23 +0000)
        * class.c (defaultable_fn_p): Handle ... properly.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144092 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 3c1975ff708f24fcbde5b4288645763fcad052bd..513465d82be4cc51c6045d4e71e6b5e93d322172 100644 (file)
@@ -1,5 +1,8 @@
 2009-02-10  Jason Merrill  <jason@redhat.com>
 
+       PR c++/38649
+       * class.c (defaultable_fn_p): Handle ... properly.
+
        PR c++/36744
        * tree.c (lvalue_p_1): Condition rvalue ref handling on
        treat_class_rvalues_as_lvalues, too.
index f56edc392a15c9dc0783aff7a07e60901e340793..d852acd9065ab0e54bdff1fd8305dc0ddd968843 100644 (file)
@@ -4138,10 +4138,11 @@ defaultable_fn_p (tree fn)
 {
   if (DECL_CONSTRUCTOR_P (fn))
     {
-      if (skip_artificial_parms_for (fn, DECL_ARGUMENTS (fn))
-         == NULL_TREE)
+      if (FUNCTION_FIRST_USER_PARMTYPE (fn) == void_list_node)
        return true;
-      else if (copy_fn_p (fn) > 0)
+      else if (copy_fn_p (fn) > 0
+              && (TREE_CHAIN (FUNCTION_FIRST_USER_PARMTYPE (fn))
+                  == void_list_node))
        return true;
       else
        return false;
index 4cb62582130f65bc4d26d2afd15d66d2cd8d434e..52817fad5b86e491f60c72f72eccbcfe2edd70fd 100644 (file)
@@ -1,5 +1,8 @@
 2009-02-11  Jason Merrill  <jason@redhat.com>
 
+       PR c++/38649
+       * g++.dg/cpp0x/defaulted8.C: New test.
+
        PR c++/36744
        * g++.dg/cpp0x/rv9p.C: New test.
 
diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted8.C b/gcc/testsuite/g++.dg/cpp0x/defaulted8.C
new file mode 100644 (file)
index 0000000..f446f81
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/38649
+// { dg-options "-std=c++0x" }
+
+struct A
+{
+  A(...) = default;            // { dg-error "cannot be defaulted" }
+  A(const A&, ...) = default;  // { dg-error "cannot be defaulted" }
+};