public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "gcc-bugzilla at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/40512] New: Compilation stops on valid code with ICE Date: Sun, 21 Jun 2009 21:32:00 -0000 [thread overview] Message-ID: <bug-40512-17863@http.gcc.gnu.org/bugzilla/> (raw) compile the attached code with the -std=c++0x flag. Environment: System: Linux x 2.6.26-2-686 #1 SMP Thu Mar 26 01:08:11 UTC 2009 i686 GNU/Linux host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: ./configure --prefix=/home/x/gcc-4.4-20090616 --enable-languages=,c,c++, How-To-Repeat: template <unsigned width, unsigned height, typename T> class M { T v; public: T & operator[](unsigned) { return v; } T const & operator[](unsigned) const { return v; } template <typename oT, unsigned owidth> auto mggggg(M<owidth, width, oT> o) -> M<owidth, height, decltype(T()*o[0])> { typedef M<owidth, height, decltype(T()*oT())> res_t; return res_t(); } template <typename oT, unsigned owidth> auto operator*(M<owidth, width, oT> const & o) const -> M<owidth, height, decltype(T()*oT())> { typedef M<owidth, height, decltype(T()*oT())> res_t; return res_t(); } }; int main(int, char *[]) { typedef M<2, 2, int> xt; M<3, 2, xt> hv; M<4, 3, xt> vv; hv.mggggg(vv); } ------- Comment #1 from pooly at ural2 dot hszk dot bme dot hu 2009-06-21 21:32 ------- Fix: Replace o[0] with oT() on line 10. -- Summary: Compilation stops on valid code with ICE Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pooly at ural2 dot hszk dot bme dot hu GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40512
next reply other threads:[~2009-06-21 21:32 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2009-06-21 21:32 gcc-bugzilla at gcc dot gnu dot org [this message] 2009-06-21 22:09 ` [Bug c++/40512] " rguenth at gcc dot gnu dot org 2010-05-05 0:44 ` paolo dot carlini at oracle dot com 2010-05-11 10:11 ` paolo dot carlini at oracle 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-40512-17863@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).