view gcc/testsuite/g++.dg/warn/Wreturn-type-12.C @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 2b5abeee2509
children
line wrap: on
line source

// PR c++/94742
// { dg-do compile { target c++11 } }
// { dg-options "-Wreturn-type" }

template <class T>
[[noreturn]] void
foo (T const &t, char const *)
{
  throw T (t);
}

template <class U>
int
bar ()
{
  foo (42, __FUNCTION__);
}	// { dg-bogus "no return statement in function returning non-void" }

int
main ()
{
  bar<long>();
}