blob: 95f5860ca6cd4859b3f91fdc812c0f65f584e7ba [file] [log] [blame]
// { 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 "3:cannot .dynamic_cast." }
}