PR c++/88122
* method.c (maybe_explain_implicit_delete): If
FUNCTION_FIRST_USER_PARMTYPE (decl) is NULL, set const_p to false
instead of ICEing.
* g++.dg/cpp0x/implicit15.C: New test.
From-SVN: r266360
2018-11-21 Jakub Jelinek <jakub@redhat.com>
+ PR c++/88122
+ * method.c (maybe_explain_implicit_delete): If
+ FUNCTION_FIRST_USER_PARMTYPE (decl) is NULL, set const_p to false
+ instead of ICEing.
+
PR c++/87386
* parser.c (cp_parser_primary_expression): Use
id_expression.get_location () instead of id_expr_token->location.
if (!informed)
{
tree parms = FUNCTION_FIRST_USER_PARMTYPE (decl);
- tree parm_type = TREE_VALUE (parms);
- bool const_p = CP_TYPE_CONST_P (non_reference (parm_type));
+ bool const_p = false;
+ if (parms)
+ {
+ tree parm_type = TREE_VALUE (parms);
+ const_p = CP_TYPE_CONST_P (non_reference (parm_type));
+ }
tree raises = NULL_TREE;
bool deleted_p = false;
tree scope = push_scope (ctype);
2018-11-21 Jakub Jelinek <jakub@redhat.com>
+ PR c++/88122
+ * g++.dg/cpp0x/implicit15.C: New test.
+
PR c++/87386
* g++.dg/diagnostic/pr87386.C: New test.
* g++.dg/parse/error17.C: Adjust expected diagnostics.
--- /dev/null
+// PR c++/88122
+// { dg-do compile { target c++11 } }
+
+struct A {
+ A (...); // { dg-message "candidate" }
+ A (); // { dg-message "candidate" }
+};
+struct B : A {
+ using A::A; // { dg-error "is ambiguous" }
+ // { dg-message "is implicitly deleted because the default definition would be ill-formed" "" { target *-*-* } .-1 }
+} b{3}; // { dg-error "use of deleted function" }