https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88245

            Bug ID: 88245
           Summary: Wrong location for "explicitly defaulted here"
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

struct X
{
  ~X();
};

X::~X() = default;

X::~X() = default;


With all versions this says:

expl.cc:8:1: error: definition of explicitly-defaulted 'X::~X()'
    8 | X::~X() = default;
      | ^
expl.cc:1:8: note: 'X::~X()' explicitly defaulted here
    1 | struct X
      |        ^

This is very unhelpful. The location of the "explicitly defaulted here" note
doesn't tell you where the first definition was (it could be nowhere near the
second definition, maybe in some included header). It certainly wasn't where
the "here" says.

Reply via email to