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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [override2.C] - Blame information for rev 774

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

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile }
2
// { dg-options "--std=c++0x" }
3
struct B1 {};
4
 
5
struct B2 final {};
6
 
7
struct D1 : B1 {};
8
 
9
struct D2 : B2 {}; // { dg-error "cannot derive from 'final' base" }
10
 
11
template struct D3 : T {};
12
 
13
template struct D4 : T {}; // { dg-error "cannot derive from 'final' base" }
14
 
15
template  struct B3 {};
16
 
17
template  struct B4 final {};
18
 
19
template  struct B5 final {};
20
 
21
struct undeclared final { }; // { dg-error "not a template" }
22
 
23
struct D5 : B3 {};
24
 
25
struct D6 : B4 {}; // { dg-error "cannot derive from 'final' base" }
26
 
27
struct B6 final final {}; // { dg-error "duplicate virt-specifier" }
28
 
29
struct B7 override {}; // { dg-error "cannot specify 'override' for a class" }
30
 
31
namespace N
32
{
33
  struct C;
34
}
35
 
36
struct N::C final{};
37
 
38
int main()
39
{
40
  D3 d;
41
  D4 d2;
42
  struct B2 final{}; // { dg-error "previous definition" }
43
  B2 final; // { dg-error "has a previous declaration|previously declared here" }
44
  B2 final2 = final;
45
  struct B2 {}; // { dg-error "redefinition" }
46
  struct B2 final; // { dg-error "redeclaration" }
47
  struct B2 override; // { dg-error "previously declared here" }
48
  struct B2 final {}; // { dg-error "redefinition" }
49
  struct B2 override {}; // { dg-error "cannot specify 'override' for a class" }
50
  B2 override{}; // { dg-error "redeclaration" }
51
  struct foo final {}; // { dg-error "previous definition" }
52
  struct foo final {}; // { dg-error "redefinition" }
53
  foo final; // { dg-error "conflicting declaration" }
54
}

powered by: WebSVN 2.1.0

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