This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/63149] wrong auto deduction from braced-init-list
- From: "richard-gccbugzilla at metafoo dot co.uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 03 Sep 2014 01:07:23 +0000
- Subject: [Bug c++/63149] wrong auto deduction from braced-init-list
- Auto-submitted: auto-generated
- References: <bug-63149-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63149
Richard Smith <richard-gccbugzilla at metafoo dot co.uk> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|can't initialize |wrong auto deduction from
|std::vector<T> from |braced-init-list
|auto-deduced type 'const |
|std::initializer_list<T> &' |
--- Comment #1 from Richard Smith <richard-gccbugzilla at metafoo dot co.uk> ---
... deduced type. [Oops, hit 'enter' early.]
Even simpler testcase:
#include <initializer_list>
const auto r = { 1, 2, 3 };
using X = decltype(r);
using X = const std::initializer_list<int>;
fails because decltype(r) is deduced as 'const std::initializer_list<const
int>' rather than 'const std::initializer_list<int>'.