This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/53361] Could not convert â{0, 0, 0}â from â<brace-enclosed initializer list>â to âstd::array<unsigned int, 3ul>â


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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]