aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/net8.C
blob: 09dfe1a83b7c4e10c4c7807a2ea8058dff361823 (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
// { dg-do assemble  }
// { dg-options "-pedantic-errors" }

class Base {
public:
  int foo;
};

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

void func(Base&);		// { dg-error "" } 

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

void
foo (int& a)
{				// { dg-error "" } 
}

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