| 1 |
// PR c++/99274 |
| 2 |
// { dg-additional-options "-fmodules-ts" } |
| 3 |
// Propagate default args from import to existing decls |
| 4 |
|
| 5 |
void f(int a, int b); |
| 6 |
template <typename T> void g(T a, T b); |
| 7 |
template <typename T, typename U> struct A; |
| 8 |
template <typename T, int N> struct B; |
| 9 |
struct S { |
| 10 |
template <typename T = int> void x(); |
| 11 |
void y(int n = 123); |
| 12 |
}; |
| 13 |
struct nontrivial { nontrivial(int); }; |
| 14 |
void h(nontrivial p); |
| 15 |
|
| 16 |
import "default-arg-1_a.H"; |
| 17 |
|
| 18 |
template <typename = A<int>, typename = B<int>> struct Q; |
| 19 |
|
| 20 |
int main() { |
| 21 |
f(1); |
| 22 |
g(2); |
| 23 |
h(); |
| 24 |
S{}.x(); |
| 25 |
S{}.y(); |
| 26 |
} |