Author
anonymous
over 7 years ago
Language
Compiler
Options
Author
anonymous
over 7 years ago
$
prog.cc:4:31: error: in-class initialization of static data member 'std::vector<short int> Fields::emptyField' of incomplete type
static std::vector<short> emptyField = {0, 0, 0, 0};
^~~~~~~~~~
prog.cc:4:55: error: temporary of non-literal type 'std::vector<short int>' in a constant expression
static std::vector<short> emptyField = {0, 0, 0, 0};
^
In file included from /opt/wandbox/gcc-head/include/c++/8.0.0/vector:64:0,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/8.0.0/bits/stl_vector.h:339:11: note: 'std::vector<short int>' is not literal because:
class vector : protected _Vector_base<_Tp, _Alloc>
^~~~~~
/opt/wandbox/gcc-head/include/c++/8.0.0/bits/stl_vector.h:339:11: note: 'std::vector<short int>' has a non-trivial destructor
prog.cc:5:31: error: in-class initialization of static data member 'std::vector<short int> Fields::leadField' of non-literal type
static std::vector<short> leadField = {0, 0, 0, 1};
^~~~~~~~~
prog.cc:5:54: error: temporary of non-literal type 'std::vector<short int>' in a constant expression
static std::vector<short> leadField = {0, 0, 0, 1};
^
prog.cc: In member function 'void A::B()':
prog.cc:12:27: error: expected ';' before 'a'
Fields::emptyField a;
^~
;
prog.cc:12:29: warning: statement has no effect [-Wunused-value]
Fields::emptyField a;
^
prog.cc: In member function 'void A::C()':
prog.cc:15:26: error: expected ';' before 'b'
Fields::leadField b;
^~
;
prog.cc:15:28: warning: statement has no effect [-Wunused-value]
Fields::leadField b;
^
Exit Code:
1