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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// Copyright (C) 2005 Free Software Foundation, Inc.
2
// Contributed by Nathan Sidwell 31 Mar 2005 
3
 
4
// { dg-do run }
5
// DR214
6
 
7
template  T f(int) {return 0;}
8
template  T f(U){return 1;}
9
 
10
template  T checked_cast (R const &) {return 0;}
11
template  T checked_cast (R *) {return 1;}
12
 
13
 
14
int main ()
15
{
16
  int i = 0;
17
 
18
  if (f(1))
19
    return 1;
20
 
21
  if (checked_cast(i) != 0)
22
    return 2;
23
 
24
  if (checked_cast(&i) != 1)
25
    return 3;
26
 
27
  return 0;
28
}

powered by: WebSVN 2.1.0

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