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]

gcc 3.0 c++ error (regression)



GCC 3.0 complains about this, which I've been told is valid (and
compiles OK with gcc 2.95.2):

struct foo {
  foo(int a, int b, int c);
};

foo::foo(int a, int b, int c=0) {}

int main(void)
{
  foo f(1,2);
}

This is extracted from the latest GROFF.

~/gnu/gcc-3.0/linux/gcc
$ ./cc1plus -quiet  foo.cc
foo.cc: In function `int main()':
foo.cc:9: no matching function for call to `foo::foo(int, int)'
foo.cc:1: candidates are: foo::foo(const foo&)
foo.cc:5:                 foo::foo(int, int, int)


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