(root)/
gcc-13.2.0/
gcc/
testsuite/
g++.dg/
ubsan/
pr81212.C
// PR c++/81212
// { dg-do compile }
// { dg-options "-Wreturn-type -fsanitize=return" }

struct S
{
  S (void *);
  void *s;
};

S
foo (bool x, void *y)
{
  if (x)
    return S (y);
}	// { dg-warning "control reaches end of non-void function" }