summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/conversion/dynamic1.C
blob: a781cbaa3fbae05553bf9e505276a64f6e0f0ea1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// PR c++/10385
// Origin: <douglas@coc.ufrj.br>
// { dg-do compile }

struct A
{
  void foo();
};

A& bar();

void baz()
{
  dynamic_cast<A&>( bar().foo );  // { dg-error "cannot dynamic_cast" }
}