public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/18207] New: wrong diagnostic for ill-formed implicitly-defined default constructor
@ 2004-10-28 20:29 boris at kolpackov dot net
  2004-10-29 13:10 ` [Bug c++/18207] misleading " pinskia at gcc dot gnu dot org
  2005-01-28  6:20 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 4+ messages in thread
From: boris at kolpackov dot net @ 2004-10-28 20:29 UTC (permalink / raw)
  To: gcc-bugs

$ 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/18207] misleading diagnostic for ill-formed implicitly-defined default constructor
  2004-10-28 20:29 [Bug c++/18207] New: wrong diagnostic for ill-formed implicitly-defined default constructor boris at kolpackov dot net
@ 2004-10-29 13:10 ` pinskia at gcc dot gnu dot org
  2005-01-28  6:20 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-29 13:10 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-29 13:10 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |diagnostic
      Known to fail|                            |2.95 3.4.3 4.0.0 3.3.3 3.2.3
   Last reconfirmed|0000-00-00 00:00:00         |2004-10-29 13:10:16
               date|                            |
            Summary|wrong diagnostic for ill-   |misleading diagnostic for
                   |formed implicitly-defined   |ill-formed implicitly-
                   |default constructor         |defined default constructor


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/18207] misleading diagnostic for ill-formed implicitly-defined default constructor
  2004-10-28 20:29 [Bug c++/18207] New: wrong diagnostic for ill-formed implicitly-defined default constructor boris at kolpackov dot net
  2004-10-29 13:10 ` [Bug c++/18207] misleading " pinskia at gcc dot gnu dot org
@ 2005-01-28  6:20 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-28  6:20 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor
   Last reconfirmed|2004-10-29 13:10:16         |2005-01-28 06:20:36
               date|                            |


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/18207] misleading diagnostic for ill-formed implicitly-defined default constructor
       [not found] <bug-18207-5779@http.gcc.gnu.org/bugzilla/>
@ 2007-08-17 16:16 ` pcarlini at suse dot de
  0 siblings, 0 replies; 4+ messages in thread
From: pcarlini at suse dot de @ 2007-08-17 16:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pcarlini at suse dot de  2007-08-17 16:15 -------
This is fixed in the active branches. Now the diagnostic is:

18207.C: In constructor 's::s()':
18207.C:8: error: no matching function for call to 'm::m()'
18207.C:4: note: candidates are: m::m(const m&)
18207.C: In constructor 's1::s1()':
18207.C:15: note: synthesized method 's::s()' first required here


-- 

pcarlini at suse dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
      Known to work|                            |4.1.2 4.2.1 4.3.0
         Resolution|                            |WORKSFORME


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-08-17 16:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-28 20:29 [Bug c++/18207] New: wrong diagnostic for ill-formed implicitly-defined default constructor boris at kolpackov dot net
2004-10-29 13:10 ` [Bug c++/18207] misleading " pinskia at gcc dot gnu dot org
2005-01-28  6:20 ` pinskia at gcc dot gnu dot org
     [not found] <bug-18207-5779@http.gcc.gnu.org/bugzilla/>
2007-08-17 16:16 ` pcarlini at suse dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).