OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [template/] [using3.C] - Blame information for rev 149

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// { dg-do run }
2
 
3
// Copyright (C) 2003 Free Software Foundation, Inc.
4
// Contributed by Nathan Sidwell 22 Jul 2003 
5
 
6
// PR 9447. Using decls in template classes.
7
 
8
template 
9
struct Foo {
10
  int i (int) {return 1;}
11
};
12
 
13
struct Baz
14
{
15
  int k (int) {return 2;}
16
};
17
 
18
template 
19
struct Bar : public Foo , Baz {
20
  using Foo::i;
21
  using Baz::k;
22
 
23
  int i (float) {return 3;}
24
  int k (float) {return 3;}
25
 
26
  int foo()
27
  {
28
    if (i (1) != 1)
29
      return 1;
30
    if (k (1) != 2)
31
      return 2;
32
 
33
    return 0;
34
  }
35
};
36
 
37
int main()
38
{
39
  Bar bar;
40
 
41
  return bar.foo();
42
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.