view gcc/testsuite/g++.dg/warn/Wreturn-type-12.C @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
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>();
}