public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/15480] ICE with sizeof(T().f()) as template parameter in function resolution Date: Mon, 17 May 2004 19:16:00 -0000 [thread overview] Message-ID: <20040517025646.3065.qmail@sourceware.org> (raw) In-Reply-To: <20040516212738.15480.gianni@mariani.ws> ------- Additional Comments From bangerth at dealii dot org 2004-05-17 02:56 ------- Here is a yet simpler example: ------------------- template <int> struct S {}; template <int> struct G { template <typename U> static int finder(U *, S< sizeof(U().foo()) > * = 0); static int finder (int *); }; int t = sizeof( G<1>::finder( (int*)0 ) ); --------------------- We ICE on this: g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc x.cc: In instantiation of `G<1>': x.cc:10: instantiated from here x.cc:5: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. I wonder if this is somehow related to the fact that we (spuriously) don't accept this code (the same as above, just that G isn't a template: ------------------- template <int> struct S {}; struct G { template <typename U> static int finder(U *, S< sizeof(U().foo()) > * = 0); static int finder (int *); }; int t = sizeof( G::finder( (int*)0 ) ); -------------------- g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc x.cc:10: error: request for member `foo' in `0', which is of non-class type `int' This should be just a SFINAE. W. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15480
next prev parent reply other threads:[~2004-05-17 2:56 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2004-05-17 8:02 [Bug c++/15480] New: " gianni at mariani dot ws 2004-05-17 8:10 ` [Bug c++/15480] " gianni at mariani dot ws 2004-05-17 8:28 ` pinskia at gcc dot gnu dot org 2004-05-17 14:36 ` giovannibajo at libero dot it 2004-05-17 15:33 ` pinskia at gcc dot gnu dot org 2004-05-17 19:16 ` gianni at mariani dot ws 2004-05-17 19:16 ` bangerth at dealii dot org [this message] 2004-05-17 19:32 ` gianni at mariani dot ws 2005-01-06 2:01 ` pinskia at gcc dot gnu dot org [not found] <bug-15480-2828@http.gcc.gnu.org/bugzilla/> 2009-04-16 16:35 ` pinskia at gcc dot gnu dot org
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=20040517025646.3065.qmail@sourceware.org \ --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).