[Bug c++/57913] New: [C++11] Explicitly defaulted constructor does not respect access specifier

charlie at charliedyson dot net gcc-bugzilla@gcc.gnu.org
Tue Jul 16 16:16:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57913

            Bug ID: 57913
           Summary: [C++11] Explicitly defaulted constructor does not
                    respect access specifier
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: charlie at charliedyson dot net

In particular, the following and similar examples will compile:

class X
{
  X() = default; // Should be private
};

int main()
{
  X x;
}

Tested with GCC Explorer.



More information about the Gcc-bugs mailing list