This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53361] Could not convert â{0, 0, 0}â from â<brace-enclosed initializer list>â to âstd::array<unsigned int, 3ul>â
- From: "roucaries.bastien+bugs at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 21 May 2012 21:19:35 +0000
- Subject: [Bug c++/53361] Could not convert â{0, 0, 0}â from â<brace-enclosed initializer list>â to âstd::array<unsigned int, 3ul>â
- Auto-submitted: auto-generated
- References: <bug-53361-4@http.gcc.gnu.org/bugzilla/>
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)