public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/20476] New: g++ crashes with a contrived template mistake.
@ 2005-03-15  1:54 olsonse at umich dot edu
  2005-03-15  1:59 ` [Bug c++/20476] " olsonse at umich dot edu
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: olsonse at umich dot edu @ 2005-03-15  1:54 UTC (permalink / raw)
  To: gcc-bugs

g++ gives an "internal compiler error: Segmentation fault"
    message where it should give an error about illegal code.  I've included
    code to cause the problem.  This code shows a mistake in the
    initialization of a template member.  The template was used incorrectly.

The simple problem code is:

/* The example code that causes the failure: */
template <int ndim_ = 0>
class bob  {
    const int ndim;
};

/* note that the mistake below causes the g++ crash:
 * bob<ndim> below should be bob<ndim_>
 */
template <int ndim_>
const int bob<ndim>::ndim = ndim_;

int main() {
    bob<> a;
    return 0;
}

-- 
           Summary: g++ crashes with a contrived template mistake.
           Product: gcc
           Version: 3.3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: olsonse at umich dot edu
                CC: gcc-bugs at gcc dot gnu dot org,olsonse at umich dot edu
 GCC build triplet: x86_64-suse-linux-gnu
  GCC host triplet: x86_64-suse-linux-gnu
GCC target triplet: x86_64-suse-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20476


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-04-28  8:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-15  1:54 [Bug c++/20476] New: g++ crashes with a contrived template mistake olsonse at umich dot edu
2005-03-15  1:59 ` [Bug c++/20476] " olsonse at umich dot edu
2005-03-15  1:59 ` [Bug c++/20476] [3.3 Regression] " pinskia at gcc dot gnu dot org
2005-04-28  8:39 ` gdr at gcc dot gnu dot org

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