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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.benjamin/] [tem05.C] - Blame information for rev 749

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

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do assemble  }
2
// 980924 bkoz
3
// just a quick test for export, to make sure we are warning for it.
4
// CHANGE ME when it's supported
5
 
6
 
7
// 14 Templates
8
//p 6
9
// A namespace-scope declaration or definintion of a non-line function
10
// template, a non-inline member function template, a non-inline
11
// member function of a class template or a static data member of a
12
// class template may be preceeded by the export keyword. If such a
13
// template is defined in the same translation unit in which it is
14
// declared as exported, the definition is considered to be
15
// exported. The first declaration of the template containing the
16
// export keyword must not follow the definition. (meaning that export
17
// can't beredeclared as non-export??)
18
 
19
// 1
20
// template definition
21
export template   // { dg-warning "" }
22
bool templ_one(T a) {
23
   if (a > 0)
24
     return true;
25
   else
26
     return false;
27
}
28
 
29
 
30
// 2
31
// static data, mf, mf template
32
template 
33
class X_one {
34
  unsigned short        id;
35
  T     type;
36
public:
37
  static const bool     is_specialized ;
38
 
39
  X_one(const unsigned short& us = 5): id(us), type(T(0)) {}
40
  unsigned short ret_id ();
41
  template  bool compare_ge(T2 test);
42
};
43
 
44
export template  // { dg-warning "" }
45
const bool X_one::is_specialized = false;
46
 
47
export template  // { dg-warning "" }
48
unsigned short X_one::ret_id() {
49
  return id;
50
}
51
 
52
export template  // { dg-warning "" }
53
bool compare_ge(T2 test) {
54
  if (test > type) // { dg-error "" } .*
55
    return true;
56
  return false;
57
}
58
 

powered by: WebSVN 2.1.0

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