OSDN Git Service

2003-01-08 Larin Hennessey <larin@science.oregonstate.edu>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.mike / net8.C
1 // Build don't link:
2 // Special g++ Options: -pedantic-errors
3
4 class Base {
5 public:
6   int foo;
7 };
8
9 class Derived : public Base {
10 public:
11   int bar;
12 };
13
14 void func(Base&);               // ERROR - 
15
16 void func2(const Derived& d) {
17   func(d);                      // ERROR - this is bad
18 }
19
20 void
21 foo (int& a)
22 {                               // ERROR - 
23 }
24
25 int main ()
26 {
27   int b;
28   const int*const a = &b;
29   *a = 10;                              // ERROR - it's const
30   foo (*a);                             // ERROR - it's const
31   return 0;
32 }