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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [parse/] [template18.C] - Blame information for rev 378

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

Line No. Rev Author Line
1 301 jeremybenn
// PR c++/22173
2
 
3
struct A
4
{
5
  static void a1();
6
  template 
7
  static void b1(T);
8
  template 
9
  struct B {
10
    static void b1();
11
    template 
12
    static void b2(T);
13
  };
14
  struct C {
15
    static void c1();
16
  };
17
};
18
 
19
template void f1()
20
{
21
  A* p;
22
  A::template a1(); // { dg-error "template" }
23
  A::template b1(0);
24
  p->template a1(); // { dg-error "template" }
25
  p->template b1('a');
26
 
27
  A::template B<0>::b1();
28
  A::template B<0>::template b1(); // { dg-error "template" }
29
  A::template B<0>::template b2(0);
30
  A::template B<0>::template b2(0);
31
 
32
  // Because B is dependent, none of these are errors, as this
33
  // function is not instantiated.
34
  A::template B::b1();
35
  A::template B::template b1();
36
  A::template B::template b2(0);
37
  A::template B::template b2(0);
38
 
39
  A::template C::c1(); // { dg-error "template" }
40
}
41
 
42
template void f2()
43
{
44
  // These are copies of lines from f1, but this function is
45
  // instantiated, so we should get errors here.
46
  A::template B::b1();
47
  A::template B::template b1(); // { dg-error "template" }
48
  A::template B::template b2(0);
49
  A::template B::template b2(0);
50
}
51
 
52
template void f2<0>(); // { dg-message "instantiated" }

powered by: WebSVN 2.1.0

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