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/] [template27.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do run  }
2
// PRMS Id: 6826
3
// Check that unnecessary templates are not instantiated.
4
 
5
template 
6
class Test
7
{
8
 public:
9
  void doThiss();
10
  void doThat();
11
};
12
 
13
template 
14
void Test::doThiss()
15
{
16
  T x;
17
 
18
  x.thiss();
19
}
20
 
21
template 
22
void Test::doThat()
23
{
24
  T x;
25
 
26
  x.that();
27
}
28
 
29
class A
30
{
31
 public:
32
  void thiss() {}
33
};
34
 
35
class B
36
{
37
 public:
38
  void that() {}
39
};
40
 
41
int main()
42
{
43
  Test a;
44
  a.doThiss();                  // a.doThat() is not well formed, but then
45
                                // it's not used so needn't be instantiated.
46
 
47
  Test b;
48
  b.doThat();                   // simillarly b.doThiss();
49
}

powered by: WebSVN 2.1.0

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