This is the mail archive of the gcc-patches@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]

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



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);
}


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