aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/warning2.C
blob: 6b51dd0521961f5d7b37e6845536ecc5fe772cef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// g++ ought to warn about casting a base pointer to a derived reference.
// Build don't link:

struct A {
  virtual int f () = 0;
};

struct B: public A { int f () { } };

int main()
{
  B* bp;
  A& ar = (A&)bp;		// WARNING - 
}