Hi,

unless we have reasons to believe that the diagnostic quality could regress in some circumstances, we can easily resolve this ICE on invalid regression by always returning error_mark_node after error (thus outside SFINAE too).

Tested x86_64-linux.

Thanks,
Paolo.

/////////////////////////
/cp
2014-02-21  Paolo Carlini  <paolo.carl...@oracle.com>

        PR c++/60253
        * call.c (convert_arg_to_ellipsis): Return error_mark_node after
        error_at.

/testsuite
2014-02-21  Paolo Carlini  <paolo.carl...@oracle.com>

        PR c++/60253
        * g++.dg/overload/ellipsis2.C: New.
Index: cp/call.c
===================================================================
--- cp/call.c   (revision 207987)
+++ cp/call.c   (working copy)
@@ -6406,8 +6406,7 @@ convert_arg_to_ellipsis (tree arg, tsubst_flags_t
          if (complain & tf_error)
            error_at (loc, "cannot pass objects of non-trivially-copyable "
                      "type %q#T through %<...%>", arg_type);
-         else
-           return error_mark_node;
+         return error_mark_node;
        }
     }
 
Index: testsuite/g++.dg/overload/ellipsis2.C
===================================================================
--- testsuite/g++.dg/overload/ellipsis2.C       (revision 0)
+++ testsuite/g++.dg/overload/ellipsis2.C       (working copy)
@@ -0,0 +1,13 @@
+// PR c++/60253
+
+struct A
+{
+  ~A();
+};
+
+struct B
+{
+  B(...);
+};
+
+B b(0, A());  // { dg-error "cannot pass" }

Reply via email to