Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/template/anon1.C @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 84e7813d76e9 |
children |
rev | line source |
---|---|
111 | 1 struct x { |
131 | 2 int foo () { return 0; } |
111 | 3 }; |
4 | |
5 template <class T> | |
6 struct vector { | |
131 | 7 T& bar () { static T a; return a; } |
111 | 8 }; |
9 | |
10 template <class T> | |
11 struct y { | |
12 typedef struct { | |
13 x t; | |
14 } s; | |
15 | |
16 vector<s> array; | |
17 | |
18 int foo () | |
19 { return array.bar().t.foo(); } | |
20 }; | |
21 int i = y<x>().foo (); |