8sa1-gcc/gcc/testsuite/g++.dg/cpp0x/constexpr-recursion3.C
Nathan Sidwell 3c98ff9b1a constexpr.c (get_fundef_copy): Use the original function for non-recursive evaluations.
cp/
	* constexpr.c (get_fundef_copy): Use the original function for
	non-recursive evaluations.
	(save_fundef_copy): Always expect a slot to be available.

	testsuite/
	* g++.dg/cpp0x/constexpr-recursion3.C: New.
	* g++.dg/ubsan/pr63956.C: Adjust error location.

From-SVN: r235506
2016-04-27 13:28:44 +00:00

15 lines
273 B
C

// { dg-do compile { target c++11 } }
constexpr int Foo (int i)
{
return (i ? Foo (i - 1): 0) + i;
}
static int a = Foo (0);
static int b = Foo (1);
static int d = Foo (3);
static int c = Foo (2);
static int e = Foo (4);
static int g = Foo (6);
static int f = Foo (5);