prog.cpp: In function 'constexpr int foo()':
prog.cpp:5:18: error: variable 's' of non-literal type 'std::string {aka std::basic_string<char>}' in 'constexpr' function
std::string s = "FooBar";
^
In file included from /usr/include/c++/5/string:52:0,
from prog.cpp:1:
/usr/include/c++/5/bits/basic_string.h:2508:11: note: 'std::basic_string<char>' is not literal because:
class basic_string
^
/usr/include/c++/5/bits/basic_string.h:2508:11: note: 'std::basic_string<char>' has a non-trivial destructor
prog.cpp: In function 'int main()':
prog.cpp:10:21: error: 'constexpr int foo()' called in a constant expression
std::array<int, foo()> arr;
^
prog.cpp:10:23: note: in template argument for type 'unsigned int'
std::array<int, foo()> arr;
^