Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/template/qual2.C @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
rev | line source |
---|---|
111 | 1 // { dg-do run } |
2 | |
3 // Copyright (C) 2003 Free Software Foundation, Inc. | |
4 // Contributed by Nathan Sidwell 23 Jan 2003 <nathan@codesourcery.com> | |
5 | |
6 // PR9415. Forgot a lookup was scoped | |
7 | |
8 int here; | |
9 int there; | |
10 | |
11 struct B | |
12 { | |
13 virtual int activate() {return !here++;} | |
14 }; | |
15 | |
16 template <class K> | |
17 struct TPL : public B | |
18 { | |
19 int activate() | |
20 { | |
21 return !there++ && B::activate(); | |
22 } | |
23 }; | |
24 | |
25 int main () | |
26 { | |
27 TPL<int> i; | |
28 return !i.activate (); | |
29 } |