This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/18207] New: wrong diagnostic for ill-formed implicitly-defined default constructor


$ cat >test.cxx
struct m
{
private:
  m (m const&);
};

struct s
{
  m m_;
};

struct s1 : s
{
  s1 ()
  {
  }
};

void f ()
{
  s1 s_;
}

$ g++-3.4 --version
g++-3.4 (GCC) 3.4.2 (Debian 3.4.2-3)
$ g++-3.4 -c test.cxx
test.cxx: In constructor `s1::s1()':
test.cxx:16: error: no matching function for call to `s::s()'
test.cxx:9: note: candidates are: s::s(const s&)

The statement "no matching function for call to `s::s()'" is wrong. According to
12.5.5 - 12.5.7 the default constructor s::s() is implicitly-declared and
defined but the definition is ill-formed due to "no matching function for call
to `m::m()'". Cheers!

-- 
           Summary: wrong diagnostic for ill-formed implicitly-defined
                    default constructor
           Product: gcc
           Version: 3.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: boris at kolpackov dot net
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-linux-gnu
  GCC host triplet: i686-linux-gnu
GCC target triplet: i686-linux-gnu


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]