comparison gcc/testsuite/g++.dg/cpp1y/func_constexpr2.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 // PR c++/87372
2 // { dg-do compile { target c++14 } }
3
4 constexpr int
5 foo (char const *s)
6 {
7 int i = 0;
8 while (s[i])
9 ++i;
10 return i;
11 }
12
13 constexpr int
14 bar ()
15 {
16 constexpr int l = foo (__PRETTY_FUNCTION__);
17 constexpr int l2 = foo (__FUNCTION__);
18 constexpr int l3 = foo (__func__);
19 return l + l2 + l3;
20 }
21 static_assert (bar () == 25, "");