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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.jason/] [template43.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do run  }
2
// Test matching of partial specializations.
3
 
4
template 
5
class EQUAL {
6
public:
7
        enum { value = 0 };
8
};
9
template 
10
class EQUAL {
11
public:
12
        enum { value = 1 };
13
};
14
 
15
int x;
16
int y;
17
 
18
int equals_x_x = EQUAL<&x,&x>::value; // expected value: 1
19
int equals_x_y = EQUAL<&x,&y>::value; // expected value: 0
20
int equals_y_x = EQUAL<&y,&x>::value; // expected value: 0
21
int equals_y_y = EQUAL<&y,&y>::value; // expected value: 1
22
 
23
int main ()
24
{
25
  if (equals_x_x == 1
26
      && equals_x_y == 0
27
      && equals_y_x == 0
28
      && equals_y_y == 1)
29
    return 0;
30
  return 1;
31
}

powered by: WebSVN 2.1.0

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