public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "z0sh at sogetthis dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/50075] New: ICE related to parameter deduction and initializer_list Date: Sat, 13 Aug 2011 13:46:00 -0000 [thread overview] Message-ID: <bug-50075-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50075 Bug #: 50075 Summary: ICE related to parameter deduction and initializer_list Classification: Unclassified Product: gcc Version: 4.6.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: z0sh@sogetthis.com Host: x86 Target: x86 [Please rephrase the title with something more appropriate, I don't know how to pin this down.] I was trying to deduce the size parameter of an std::array<T,N> from the size of an initializer list. The following code is probably not correct, but in any event, it causes GCC 4.6.1 with -std=c++0x to crash: #include <functional> #include <array> template <typename T, unsigned int N> std::array<T, N> make_array_helper(const std::initializer_list<T> & il) { return std::array<T, N>(il); } template <typename T> auto make_array(const std::initializer_list<T> & il) -> decltype(make_array(il)) { return make_array_helper<T, il.size()>(il); } int main() { auto z = make_array({{1,2}}); }
next reply other threads:[~2011-08-13 13:08 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-08-13 13:46 z0sh at sogetthis dot com [this message] 2011-08-13 14:09 ` [Bug c++/50075] " redi at gcc dot gnu.org 2011-08-13 14:28 ` z0sh at sogetthis dot com 2011-08-13 15:56 ` redi at gcc dot gnu.org 2011-08-13 23:02 ` [Bug c++/50075] [C++0x] " jason at gcc dot gnu.org 2011-08-14 4:43 ` jason at gcc dot gnu.org 2011-08-14 8:12 ` jason at gcc dot gnu.org 2011-08-15 13:58 ` z0sh at sogetthis dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-50075-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).