This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/616: ss 2000/10/02 generates invalid warning
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/616: ss 2000/10/02 generates invalid warning
- From: wolfgang dot bangerth at iwr dot uni-heidelberg dot de
- Date: 6 Oct 2000 14:02:23 -0000
- Reply-To: wolfgang dot bangerth at iwr dot uni-heidelberg dot de
- Resent-Cc: gcc-prs at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, jason at gcc dot gnu dot org
- Resent-Reply-To: gcc-gnats@gcc.gnu.org, wolfgang.bangerth@iwr.uni-heidelberg.de
>Number: 616
>Category: c++
>Synopsis: ss 2000/10/02 generates invalid warning
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Fri Oct 06 07:06:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Wolfgang Bangerth
>Release: unknown-1.0
>Organization:
>Environment:
gcc ss 2000-10-02
Linux
>Description:
For the following code snippet, the latest snapshot generates
an invalid warning (which one can not work around, unfortunately):
----------------------------------------
template <int dim> struct X { X (int i=1); };
template <int dim> void f() {
const X<dim> x;
};
template void f<3> ();
------------------------------------------
Compiled with
c++ -c abc.cc
and snapshot 2000-10-02, the output is:
abc.cc: In function `void f() [with int dim = 3]':
abc.cc:7: instantiated from here
abc.cc:4: uninitialized const `x'
which is clearly bogus as the constructor with default
parameter should have been called (and indeed is, as can
be seen from the assembler output -- I wonder why the
compiler fails but still produces an assembler file
if called with -S, while it does not generate a file
if called with -c).
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: