Gcc 4.3 revision 132153 failed to compile:

[EMAIL PROTECTED] build_base_o2.0000]$ cat x.cc
#include <vector>
template <typename Number>
class Vector
{
};
template <int dim>
class Foo
{
  public:
    virtual void foo (const unsigned int);
    struct Data
    {
      std::vector<Vector<double> > bar;
    };
};

template <int dim>
void Foo<dim>::foo (const unsigned int n)
{
  std::vector<Data> data(n);
}
template class Foo<3>;
[EMAIL PROTECTED] build_base_o2.0000]$  /usr/gcc-4.3/bin/gcc -O2 x.cc -S
x.cc: In member function âvoid Foo<dim>::foo(unsigned int) [with int dim = 3]â:
x.cc:22:   instantiated from here
x.cc:20: error: void value not ignored as it ought to be
[EMAIL PROTECTED] build_base_o2.0000]$ 

Revision 131899 is OK.


-- 
           Summary: [4.3 Regression]: Fail to compile valid code
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hjl dot tools at gmail dot com


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

Reply via email to