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++/63149] wrong auto deduction from braced-init-list


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>'.


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