From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15755 invoked by alias); 9 Feb 2002 20:36:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 15720 invoked by uid 71); 9 Feb 2002 20:36:00 -0000 Resent-Date: 9 Feb 2002 20:36:00 -0000 Resent-Message-ID: <20020209203600.15719.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, tuffner@autotote.com Resent-Reply-To: gcc-gnats@gcc.gnu.org, tom@wact.net Received:(qmail 2220 invoked by uid 61); 9 Feb 2002 20:31:10 -0000 Message-Id:<20020209203110.2219.qmail@sources.redhat.com> Date: Sat, 09 Feb 2002 12:36:00 -0000 From: tom@wact.net Reply-To: tom@wact.net To: gcc-gnats@gcc.gnu.org Cc: tuffner@autotote.com X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) X-GNATS-Notify:tuffner@autotote.com Subject: c++/5645: gcc warns that pure virtual class not explicitly initialized X-SW-Source: 2002-02/txt/msg00223.txt.bz2 List-Id: >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: