[testcase] g++.old-deja/g++.other/defarg9.C

DJ Delorie dj@redhat.com
Fri Mar 23 18:45:00 GMT 2001


This shows a regression from 2.95.2 to 3.0.

2001-03-23  DJ Delorie  <dj@redhat.com>

	* g++.old-deja/g++.other/defarg9.C: New, verify that default
	arguments can come from either definitions or declarations.


// Build don't link:

// Make sure default arguments can be used both in the declaration
// and the definition.

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

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

struct bar {
  bar(int a, int b, int c=0);
};

bar::bar(int a, int b, int c) {}

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



More information about the Gcc-patches mailing list