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]

c++/616: ss 2000/10/02 generates invalid warning



>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:

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