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++.dg/] [template/] [dependent-name5.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// PR c++/9634, c++/29469, c++/29607
2
// Contributed by: Giovanni Bajo 
3
// DR224: Make sure that a name is *truly* semantically dependent.
4
 
5
struct D {
6
  typedef int K;
7
};
8
 
9
template 
10
struct A
11
{
12
  typedef int Bar;
13
 
14
  template 
15
  struct N {};
16
 
17
  typedef Bar          type1;
18
  typedef A::Bar       type2;
19
  typedef A::Bar    type3;
20
  typedef A::Bar    type4;  // { dg-error "" }
21
  typedef typename A::Bar type5;
22
 
23
  typedef N       type6;
24
  typedef A::N    type7;
25
  typedef A::N type8;
26
  typedef A::template N type9;  // { dg-error "" }
27
  typedef typename A::template N type10;
28
 
29
  typedef D Bar2;
30
  struct N2 { typedef int K; };
31
 
32
  // Check that A::N2 is still considered dependent (because it
33
  //  could be specialized), while A::Bar2 (being just ::D) is not.
34
  typedef A::Bar2 type11;
35
  typedef type11::K k3;
36
 
37
  typedef A::N2 type12;
38
  typedef typename type12::K k2;
39
  typedef type12::K k1;  // { dg-error "" }
40
 
41
  // Check that A::Bar2 is not considered dependent even if we use
42
  // the typename keyword.
43
  typedef typename A::Bar2 type13;
44
  typedef type13::K k4;
45
};

powered by: WebSVN 2.1.0

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