diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/decl.cc | 1 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp23/explicit-obj-diagnostics9.C | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc index b10a72a..2e57029 100644 --- a/gcc/cp/decl.cc +++ b/gcc/cp/decl.cc @@ -13743,6 +13743,7 @@ grokdeclarator (const cp_declarator *declarator, "destructors may not have parameters"); arg_types = void_list_node; parms = NULL_TREE; + is_xobj_member_function = false; } type = build_function_type (type, arg_types); diff --git a/gcc/testsuite/g++.dg/cpp23/explicit-obj-diagnostics9.C b/gcc/testsuite/g++.dg/cpp23/explicit-obj-diagnostics9.C new file mode 100644 index 0000000..d420793 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp23/explicit-obj-diagnostics9.C @@ -0,0 +1,6 @@ +// PR c++/113340 +// { dg-do compile { target c++23 } } + +struct S { + ~S(this S &) = default; // { dg-error "destructors may not have parameters" } +}; |