| 1 |
// { dg-options "-fpermissive -w" } |
| 2 |
|
| 3 |
// Copyright (C) 2003 Free Software Foundation, Inc. |
| 4 |
// Contributed by Nathan Sidwell 3 Jul 2003 <[email protected]> |
| 5 |
|
| 6 |
// PR c++ 9162. default args got left unprocessed |
| 7 |
|
| 8 |
struct S { |
| 9 |
friend int foo (const S&, int = 100); |
| 10 |
}; |
| 11 |
S s; |
| 12 |
int i = foo (s); |
| 13 |
|
| 14 |
struct R |
| 15 |
{ |
| 16 |
template <typename T> R (T, int = 0); |
| 17 |
}; |
| 18 |
|
| 19 |
int Foo () |
| 20 |
{ |
| 21 |
R s (1); |
| 22 |
return 0; |
| 23 |
} |
| 24 |
|
| 25 |
template <typename T> struct Q |
| 26 |
{ |
| 27 |
int Foo (T, int = 0); |
| 28 |
}; |
| 29 |
|
| 30 |
int Foo (Q<int> *s) |
| 31 |
{ |
| 32 |
s->Foo (1); |
| 33 |
return 1; |
| 34 |
} |