Author
anonymous
almost 6 years ago
Language
C++
Compiler
gcc HEAD 10.0.1 20200219 (experimental)
Options
Don't Use Boost
C++2a
no pedantic
Author
anonymous
almost 6 years ago
$ g++ prog.cc -std=c++2a prog.cc: In function 'int main()':
prog.cc:6:36: error: the type 'const std::vector<int>' of 'constexpr' variable 'compile_time_vector' is not literal
6 | constexpr std::vector<int32_t> compile_time_vector{1, 2, 3, 4, 5};
| ^~~~~~~~~~~~~~~~~~~
In file included from /opt/wandbox/gcc-head/include/c++/10.0.1/vector:67,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/10.0.1/bits/stl_vector.h:386:11: note: 'std::vector<int>' is not literal because:
386 | class vector : protected _Vector_base<_Tp, _Alloc>
| ^~~~~~
/opt/wandbox/gcc-head/include/c++/10.0.1/bits/stl_vector.h:386:11: note: 'std::vector<int>' does not have 'constexpr' destructor
prog.cc:7:27: error: the type 'const string' {aka 'const std::__cxx11::basic_string<char>'} of 'constexpr' variable 'compile_time_string' is not literal
7 | constexpr std::string compile_time_string{"abc"};
| ^~~~~~~~~~~~~~~~~~~
In file included from /opt/wandbox/gcc-head/include/c++/10.0.1/string:55,
from prog.cc:2:
/opt/wandbox/gcc-head/include/c++/10.0.1/bits/basic_string.h:77:11: note: 'std::__cxx11::basic_string<char>' is not literal because:
77 | class basic_string
| ^~~~~~~~~~~~
/opt/wandbox/gcc-head/include/c++/10.0.1/bits/basic_string.h:77:11: note: 'std::__cxx11::basic_string<char>' does not have 'constexpr' destructor
Exit Code:
1