https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80259
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
With untested:
--- gcc/decl2.c.jj 2017-02-21 18:59:36.000000000 +0100
+++ gcc/decl2.c 2017-03-30 10:16:03.972113673 +0200
@@ -888,9 +888,18 @@ grokfield (const cp_declarator *declarat
{
if (init == ridpointers[(int)RID_DELETE])
{
- DECL_DELETED_FN (value) = 1;
- DECL_DECLARED_INLINE_P (value) = 1;
- DECL_INITIAL (value) = error_mark_node;
+ if (friendp && decl_defined_p (value))
+ {
+ error ("redefinition of %q#D", value);
+ inform (DECL_SOURCE_LOCATION (value),
+ "%q#D previously defined here", value);
+ }
+ else
+ {
+ DECL_DELETED_FN (value) = 1;
+ DECL_DECLARED_INLINE_P (value) = 1;
+ DECL_INITIAL (value) = error_mark_node;
+ }
}
else if (init == ridpointers[(int)RID_DEFAULT])
{
I get:
pr80259.C:5:23: error: redefinition of ‘void foo()’
friend void foo() = delete;
^~~~~~
pr80259.C:1:6: note: ‘void foo()’ previously defined here
void foo() {}
^~~
but no idea if you don't want to resolve it differently.