¿Por qué la advertencia de clang++ "sugiere llaves alrededor de la inicialización del subobjeto [- Wmissing-llaves]"?
Tengo este código:
#include <array>
int main(int, char **argv)
{
std::array<int, 3> a = {1,2,3};
}
Esto compila bien (- std = c++11), pero si incluyes-Wall da esta advertencia que no entiendo:
clang_pp_error.cpp:5:28: warning: suggest braces around initialization of subobject [-Wmissing-braces]
std::array<int, 3> a = {1,2,3};
^~~~~
{ }
30
2 answers
Esto debería ser un error: https://llvm.org/bugs/show_bug.cgi?id=21629 .
Ver también ¿Es prudente ignorar la advertencia "-Wmissing-braces" de gcc/clang?.
14
Author: FrankHB,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-05-23 12:10:29
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-05-23 12:10:29
Use std::array<int, 3> a = {{1,2,3}};
en su lugar.
13
Author: Sohail Si,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-05-23 11:47:19
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-05-23 11:47:19