public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/5645: gcc warns that pure virtual class not explicitly initialized
@ 2002-09-14 15:44 nathan
  0 siblings, 0 replies; 2+ messages in thread
From: nathan @ 2002-09-14 15:44 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, tom, tuffner

Synopsis: gcc warns that pure virtual class not explicitly initialized

State-Changed-From-To: open->closed
State-Changed-By: nathan
State-Changed-When: Sat Sep 14 15:44:46 2002
State-Changed-Why:
    fixed in cvs

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5645


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

* c++/5645: gcc warns that pure virtual class not explicitly initialized
@ 2002-02-09 12:36 tom
  0 siblings, 0 replies; 2+ messages in thread
From: tom @ 2002-02-09 12:36 UTC (permalink / raw)
  To: gcc-gnats; +Cc: tuffner


>Number:         5645
>Category:       c++
>Synopsis:       gcc warns that pure virtual class not explicitly initialized
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 09 12:36:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Tom Uffner
>Release:        gcc version 3.0.3
>Organization:
>Environment:
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.0.3/specs
Configured with: ../configure --with-as=/usr/local/bin/as --with-ld=/usr/local/bin/ld --enable-libgcj
Thread model: posix
gcc version 3.0.3
 /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.0.3/cc1plus -v -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=3 -Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4 -D__sparc__ -D__sun__ -D__unix__ -D__svr4__ -D__SVR4 -D__sparc -D__sun -D__unix -Asystem=unix -Asystem=svr4 -D__NO_INLINE__ -D__STDC_HOSTED__=1 -W -D_XOPEN_SOURCE=500 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -D__EXTENSIONS__ -D__GCC_NEW_VARARGS__ -Acpu=sparc -Amachine=sparc moo.cpp -D__GNUG__=3 -D__GXX_DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -quiet -dumpbase moo.cpp -W -version -o /var/tmp/cc9O5r3j.s
GNU CPP version 3.0.3 (cpplib) (sparc)
GNU C++ version 3.0.3 (sparc-sun-solaris2.8)
        compiled by GNU C version 3.0.3.
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/g++-v3
 /usr/local/include/g++-v3/sparc-sun-solaris2.8
 /usr/local/include/g++-v3/backward
 /usr/local/include
 /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.0.3/include
 /usr/local/sparc-sun-solaris2.8/include
 /usr/include
End of search list.
>Description:
g++ issues a warning that a pure virtual base class with
no data members should be initialized when when it compiles
copy constructors of a derived class. 

this error also occurs in previous compiler versions and
platforms other than the one this PR was submitted from
>How-To-Repeat:
class a {
public:
    virtual int f() = 0;
    virtual int g() = 0;
};

class b : public a {
public:
    b();
    b(const b& c);

protected:
    int i;
};

b::b() {}

b::b(const b& c) {
    i = c.i;
}

% c++ -v -W -Wall -c moo.cpp
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.0.3/specs
Configured with: ../configure --with-as=/usr/local/bin/as --with-ld=/usr/local/bin/ld --enable-libgcj
Thread model: posix
gcc version 3.0.3
 /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.0.3/cc1plus -v -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=3 -Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4 -D__sparc__ -D__sun__ -D__unix__ -D__svr4__ -D__SVR4 -D__sparc -D__sun -D__unix -Asystem=unix -Asystem=svr4 -D__NO_INLINE__ -D__STDC_HOSTED__=1 -W -Wall -D_XOPEN_SOURCE=500 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -D__EXTENSIONS__ -D__GCC_NEW_VARARGS__ -Acpu=sparc -Amachine=sparc moo.cpp -D__GNUG__=3 -D__GXX_DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -quiet -dumpbase moo.cpp -W -Wall -version -o /var/tmp/ccOlmk8T.s
GNU CPP version 3.0.3 (cpplib) (sparc)
GNU C++ version 3.0.3 (sparc-sun-solaris2.8)
        compiled by GNU C version 3.0.3.
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/g++-v3
 /usr/local/include/g++-v3/sparc-sun-solaris2.8
 /usr/local/include/g++-v3/backward
 /usr/local/include
 /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.0.3/include
 /usr/local/sparc-sun-solaris2.8/include
 /usr/include
End of search list.
moo.cpp: In copy constructor `b::b(const b&)':
moo.cpp:19: warning: base class `class a' should be explicitly initialized in 
   the copy constructor
 /usr/local/bin/as -V -Qy -s -o moo.o /var/tmp/ccOlmk8T.s
GNU assembler version 2.11.2 (sparc-sun-solaris2.8) using BFD version 2.11.2
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2002-09-14 22:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-14 15:44 c++/5645: gcc warns that pure virtual class not explicitly initialized nathan
  -- strict thread matches above, loose matches on Subject: below --
2002-02-09 12:36 tom

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).