aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ubsan/pr68508.C
blob: ffe8f0071dbc5a41c7e75863b735722696fc9d8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// PR c++/68508
// { dg-do compile }
// { dg-options "-std=c++14 -fsanitize=vptr" }

struct A
{
  virtual int foo () { return 0; }
};

const A &
bar ()
{
  static A x = A ();
  return (x);
}