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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [template/] [spec26.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// dg-do run
2
// Copyright (C) 2005 Free Software Foundation, Inc.
3
// Contributed by Nathan Sidwell 16 Sep 2005 
4
 
5
// PR 23519  template specialization ordering (DR214)
6
// Origin:  Maxim Yegorushkin 
7
 
8
struct A
9
{
10
    template int operator+(T&) { return 1;}
11
};
12
 
13
template struct B
14
{
15
  int operator-(A&) {return 2;}
16
  template int operator*(R&) {return 3;}
17
};
18
 
19
template  int operator-(B, R&) {return 4;}
20
template int operator+(A&, B&) { return 5;}
21
template  int operator*(T &, A&){return 6;}
22
 
23
int main()
24
{
25
  A a;
26
  B b;
27
  if ((a + b) != 5)
28
    return 1;
29
 
30
  if ((b - a) != 2)
31
    return 2;
32
 
33
  if ((b * a) != 6)
34
    return 3;
35
}

powered by: WebSVN 2.1.0

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