public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: rubin@contractor.net
To: gcc-gnats@gcc.gnu.org
Subject: c++/6949: ICE in tsubst_decl, at cp/pt.c:5733
Date: Thu, 06 Jun 2002 13:36:00 -0000	[thread overview]
Message-ID: <20020606203019.32319.qmail@sources.redhat.com> (raw)


>Number:         6949
>Category:       c++
>Synopsis:       ICE in tsubst_decl, at cp/pt.c:5733
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Thu Jun 06 13:36:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Bill Rubin
>Release:        3.1
>Organization:
>Environment:
Cygwin on Windows XP Professional
>Description:
This ICE is caused by a class nested inside a local class of a templated member function.  The code snippet below is illustrative of the ICE in my application.  I found that small changes in the snippet cause the ICE to disappear, or to pop up in another place.  For example, just replacing

                      void funct();
with
                      void funct(){}

causes the ICE to disappear!

//========= Compiler output ================

$ gcc -v -save-temps GccBug2.cpp
Reading specs from /usr/local/lib/gcc-lib/i686-pc-cygwin/3.1/specs
Configured with: ../gcc-3.1/configure --enable-threads=win32
Thread model: win32
gcc version 3.1
// ... junk elided here ...
GNU CPP version 3.1 (cpplib) (80386, BSD syntax)
GNU C++ version 3.1 (i686-pc-cygwin)
        compiled by GNU C version 3.1.
GccBug2.cpp: In instantiation of `Struct::templatedMemberFunction(const T&) 
             [with T = int]::LocalClass::NestedClass':
GccBug2.cpp:6:   instantiated from `Struct::templatedMemberFunction(const T&) 
                 [with T = int]::LocalClass'
GccBug2.cpp:16:   instantiated from `void Struct::templatedMemberFunction
                  (const T&) [with T = int]'
GccBug2.cpp:23:   instantiated from here
GccBug2.cpp:7: Internal compiler error in tsubst_decl, at cp/pt.c:5733
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

//========= Source File GccBug2.cpp Begins Here ===========
struct Struct {
  template<class T> void templatedMemberFunction(const T&) {

    class LocalClass {

        struct NestedClass {
          void funct();
          };

        NestedClass nestedClassInstance_;

      public:
        void memberFunction() {nestedClassInstance_.funct();}
      };

    LocalClass localClass;
    localClass.memberFunction();
    };
};

void globalFunction() {
  Struct classInstance;
  classInstance.templatedMemberFunction(42);
}
//========= Source File GccBug2.cpp Ends Here =============
>How-To-Repeat:
Invoke the compiler on GccBug2.cpp.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2002-06-06 20:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-06 13:36 rubin [this message]
2002-06-07  7:03 lerdsuwa

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=20020606203019.32319.qmail@sources.redhat.com \
    --to=rubin@contractor.net \
    --cc=gcc-gnats@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: link
Be 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).