OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.other/] [decl5.C] - Blame information for rev 305

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do assemble  }
2
 
3
// Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
4
// Contributed by Nathan Sidwell 22 Apr 1999 
5
// derived from a bug report by 
6
// http://gcc.gnu.org/ml/gcc-bugs/1999-04n/msg00631.html
7
// the code is wrong, but we fell over badly
8
 
9
 
10
struct A {
11
  int A::fn();        // { dg-error "extra qualification" }
12
  int A::m;           // { dg-error "extra qualification" }
13
  struct e;
14
  struct A::e {int i;}; // { dg-error "extra qualification" "qual" }
15
  // { dg-error "anonymous struct" "anon" { target *-*-* } 14 }
16
  struct A::expand {  // { dg-error "qualified name" }
17
  int m;
18
  };
19
  struct Z;
20
  expand me;          // { dg-error "'expand' does not name a type" }
21
  void foo(struct A::e);
22
  void foo(struct A::z);  // { dg-error "does not name a type" }
23
};
24
 
25
struct Q;
26
struct B {
27
  struct A::fink {    // { dg-error "does not name a class before" }
28
  int m;
29
  };
30
  struct A::Z {       // { dg-error "does not enclose" } A::Z not a member of B
31
    int m;
32
  };
33
  int m;
34
  int n;
35
  struct ::Q {        // { dg-error "global qual" } ::Q not a member of B
36
    int m;
37
  };
38
  int A::fn() {       // { dg-error "cannot define member" } A::fn not a member of B
39
    return 0;
40
  }
41
  void fn(struct ::Q &);
42
  void foo(struct A::y);  // { dg-error "does not name a type" } no such member
43
};
44
 
45
struct ::C {          // { dg-error "invalid before" } extra qualification
46
  int i;
47
};
48
 
49
namespace N {
50
  int fn();
51
  struct F;
52
}
53
 
54
namespace NMS
55
{
56
  void NMS::fn();     // { dg-error "explicit qual" }
57
  int NMS::i;         // { dg-error "explicit qual" }
58
  struct NMS::D {     // { dg-error "does not name a class" }
59
    int i;
60
  };
61
  struct N::E {       // { dg-error "does not name a class" } no such type
62
    int i;
63
  };
64
  struct ::F {        // { dg-error "global qual" } no such type
65
    int i;
66
  };
67
  int N::fn() {       // { dg-error "namespace" } N::fn not a member of NMS
68
    return 0;
69
  }
70
  struct N::F {       // { dg-error "namespace" } N::F not a member of NMS
71
    int i;
72
  };
73
}
74
 
75
NMS::D thing;         // { dg-error "'D' in namespace 'NMS' does not name a type" }
76
void NMS::fn()
77
{
78
  i = 3;
79
}

powered by: WebSVN 2.1.0

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