blob: 3003b62ca0a40778bf25f3edccbf803b01dd2296 [file] [log] [blame]
// { dg-options "-fgnu-tm -std=c++14 -O2" }
void unsafe();
struct A {
virtual void f() transaction_safe_dynamic;
};
struct B:A {
void f() { unsafe(); }
};
void f() transaction_safe {
B b;
A& ar = b;
// This is undefined behavior, we want to give an error with
// devirtualization.
ar.f(); // { dg-error "unsafe" }
}