aboutsummaryrefslogtreecommitdiffstats
path: root/lib/entityx/cxx11/c++11-test-constexpr-N2235.cpp
blob: ed624512d8eeabdd6c379512f76854e76f037da3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
constexpr int square(int x)
{
	return x*x;
}

constexpr int the_answer()
{
	return 42;
}

int main()
{
	int test_arr[square(3)];
	bool ret = (
		(square(the_answer()) == 1764) &&
		(sizeof(test_arr)/sizeof(test_arr[0]) == 9)
	);
	return ret ? 0 : 1;
}