annotate gcc/testsuite/g++.dg/parse/defarg4.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1 // { dg-options "-fpermissive -w" }
111
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 // Copyright (C) 2003 Free Software Foundation, Inc.
kono
parents:
diff changeset
4 // Contributed by Nathan Sidwell 3 Jul 2003 <nathan@codesourcery.com>
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 // PR c++ 9162. default args got left unprocessed
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 struct S {
kono
parents:
diff changeset
9 friend int foo (const S&, int = 100);
kono
parents:
diff changeset
10 };
kono
parents:
diff changeset
11 S s;
kono
parents:
diff changeset
12 int i = foo (s);
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 struct R
kono
parents:
diff changeset
15 {
kono
parents:
diff changeset
16 template <typename T> R (T, int = 0);
kono
parents:
diff changeset
17 };
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 int Foo ()
kono
parents:
diff changeset
20 {
kono
parents:
diff changeset
21 R s (1);
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
22 return 0;
111
kono
parents:
diff changeset
23 }
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 template <typename T> struct Q
kono
parents:
diff changeset
26 {
kono
parents:
diff changeset
27 int Foo (T, int = 0);
kono
parents:
diff changeset
28 };
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 int Foo (Q<int> *s)
kono
parents:
diff changeset
31 {
kono
parents:
diff changeset
32 s->Foo (1);
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
33 return 1;
111
kono
parents:
diff changeset
34 }