I compiled code with GCC with -Walland included -Wextra. This code issues a warning:
struct A { A(int) {} };
struct B {};
struct C : A, B {};
int main() {
(void) C{1};
}
main.cpp: In function 'int main()':
main.cpp:11:15: warning: missing initializer for member 'C::<anonymous>' [-Wmissing-field-initializers]
(void) C{1};
^
Should I worry about this? Is there a bug in GCC to display this warning? It seems I do not have a field for initialization and missing parameters.
source
share