summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/p7476.C
blob: 04d77880f93c67986abced869553cbae2420cd87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// { dg-do assemble  }
// prms-id: 7476

class HeapTracked {
public:
  virtual ~HeapTracked() { }
  static void isObjectAllocation(const HeapTracked *ptr);
  static void isObjectAllocation(HeapTracked *ptr);
};

void HeapTracked::isObjectAllocation(HeapTracked *ptr)
{
  dynamic_cast<const void*>(ptr);
  dynamic_cast<void*>(ptr);
}
void HeapTracked::isObjectAllocation(const HeapTracked *ptr)
{
  const_cast<void*>(dynamic_cast<const void*>(ptr));
  dynamic_cast<void*>(ptr);		// { dg-error "" } 
}