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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 693 jeremybenn
// Origin: PR c++/47398
2
// { dg-do compile }
3
 
4
template
5
struct A
6
{
7
  typedef int INT;
8
};
9
 
10
template
11
struct transform
12
{
13
  static int bar();
14
};
15
 
16
template
17
struct B
18
{
19
  typedef typename A::INT TINT;
20
  void baz();
21
};
22
 
23
template
24
struct B
25
{
26
  typedef typename A::INT TINT;
27
  void foo();
28
};
29
 
30
template
31
void
32
B::baz()
33
{
34
  int c = transform::bar();//#0
35
}
36
 
37
template
38
void
39
B::foo()
40
{
41
  int c = transform::bar();//#1
42
}
43
 
44
int
45
main()
46
{
47
  B i;
48
  i.foo();
49
  // While instantiating
50
  //
51
  //   template void B::foo()
52
  //
53
  // lookup_template_class resolves transform in #1 to
54
  // the wrong one; it picks up the one in #0 instead. This is because
55
  // to compare the two A comp_template_args uses cp_tree_equal
56
  // that fails to consider the number of siblings of parm 'a'.
57
return 0;
58
}

powered by: WebSVN 2.1.0

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