[Bug c++/53361] Could not convert ‘{0?=, 0,=?UTF-8?Q? 0}’ from ‘?=<brace-enclosed initializer list>=?UTF-8?Q?’ to ‘std?=::array<unsigned int, 3ul>=?UTF-8?Q?’
roucaries.bastien+bugs at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon May 21 21:36:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53361
--- Comment #3 from Bastien ROUCARIES <roucaries.bastien+bugs at gmail dot com> 2012-05-21 21:19:35 UTC ---
bastien@bastien-debian:/tmp$ cat test.c
#include <array>
void function(std::array<unsigned int,3> a)
{
}
int main()
{
// ok
std::array<unsigned int,3> vec {0, 0, 0};
// error: could not convert '{"hello", "world", "test"}' to
//'std::vector...'
function({0,0,0});
}
bastien@bastien-debian:/tmp$ g++-4.7 -std=c++11 test.c
test.c: In function ‘int main()’:
test.c:14:17: error: could not convert ‘{0, 0, 0}’ from ‘<brace-enclosed
initializer list>’ to ‘std::array<unsigned int, 3ul>’
bastien@bastien-debian:/tmp$ g++-4.7 --version
g++-4.7 (Debian 4.7.0-7) 4.7.0
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
So it does not work under debian testing of the day (upgraded today)
More information about the Gcc-bugs
mailing list