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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [overload/] [member2.C] - Blame information for rev 707

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

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do run }
2
 
3
// Copyright (C) 2001 Free Software Foundation, Inc.
4
// Contributed by Nathan Sidwell 17 Oct 2002 
5
 
6
// PR 7676. We didn't notice template members were different.
7
 
8
struct foo
9
{
10
  template
11
  int bar() {return 1;}
12
 
13
  template
14
  int bar() {return 2;}
15
 
16
};
17
 
18
struct baz : foo
19
{
20
  using foo::bar;
21
  template
22
  int bar () {return 3;}
23
};
24
 
25
int main ()
26
{
27
  baz b;
28
  foo f;
29
 
30
  if (f.bar<1> () != 2)
31
    return 1;
32
  if (f.bar () != 1)
33
    return 2;
34
 
35
  if (b.bar<1> () != 3)
36
    return 1;
37
  if (b.bar () != 1)
38
    return 2;
39
 
40
  return 0;
41
}

powered by: WebSVN 2.1.0

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