aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/net8.C
blob: 12823175a245ffa29e8edf26792a7f35809259e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Build don't link:
// Special g++ Options: -pedantic-errors

class Base {
public:
  int foo;
};

class Derived : public Base {
public:
  int bar;
};

void func(Base&);		// ERROR - 

void func2(const Derived& d) {
  func(d);			// ERROR - this is bad
}

void
foo (int& a)
{				// ERROR - 
}

int main ()
{
  int b;
  const int*const a = &b;
  *a = 10;				// ERROR - it's const
  foo (*a);				// ERROR - it's const
  return 0;
}