blob: c17440a30eb82bcae37441259798ba448fa54e15 [file] [log] [blame]
/* { dg-options "-O2 -std=c++11 -fdump-ipa-inline" } */
#include <new>
class EmbeddedObject {
public:
virtual int val() { return 2; }
};
class Container {
alignas(EmbeddedObject) char buffer[sizeof(EmbeddedObject)];
public:
EmbeddedObject *obj() { return (EmbeddedObject*)buffer; }
Container() { new (buffer) EmbeddedObject(); }
};
Container o;
int main()
{
__builtin_printf("%d\n", o.obj()->val());
}
/* { dg-final { scan-ipa-dump-not "__builtin_unreachable" "inline" } } */