PR c++/59480, DR 136
[official-gcc.git] / gcc / testsuite / g++.dg / parse / defarg4.C
blobad8a1ed6c65c65a5b87f3e06a5dba5eea05f2e95
1 // { dg-options "-fpermissive -w" }
3 // Copyright (C) 2003 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 3 Jul 2003 <nathan@codesourcery.com>
6 // PR c++ 9162. default args got left unprocessed
8 struct S {
9   friend int foo (const S&, int = 100);
11 S s;
12 int i = foo (s);
14 struct R
16   template <typename T> R (T, int = 0);
19 int Foo ()
21   R s (1);
22   return 0;
25 template <typename T> struct Q
27   int Foo (T, int = 0);
30 int Foo (Q<int> *s)
32   s->Foo (1);
33   return 1;