public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: llewins@raytheon.com
To: gcc-gnats@gcc.gnu.org
Cc: llewins@raytheon.com
Subject: c++/10867: Internal compiler error with constant enum
Date: Mon, 19 May 2003 16:36:00 -0000	[thread overview]
Message-ID: <20030519163309.24353.qmail@sources.redhat.com> (raw)


>Number:         10867
>Category:       c++
>Synopsis:       Internal compiler error with constant enum
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 19 16:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Lloyd Lewins
>Release:        gcc version 3.2
>Organization:
>Environment:
Cygwin
>Description:
The attached file generates the following error:

conversion.cc:8: warning: all member functions in class `Conversion<T, U>' are
   private
conversion.cc: In instantiation of `const unsigned int Conversion<double, int>::
t':
conversion.cc:23:   instantiated from `Conversion<double, int>'
conversion.cc:23:   instantiated from here
conversion.cc:15: Internal compiler error in instantiate_decl, at cp/pt.c:10052
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="conversion.cc"
Content-Disposition: inline; filename="conversion.cc"

#include <vector>
#include <iostream>

using namespace std;

template<class T, class U>
class Conversion
{
    typedef char Small;
    class Big { char dummy[2]; };
    static Small Test(U);
    static Big Test(...);
    static T MakeT();
public:
    static const unsigned t = sizeof(MakeT());
    enum {
        exists = t
    };
};

int main(void)
{
    Conversion<double, int> d;
}


             reply	other threads:[~2003-05-19 16:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-19 16:36 llewins [this message]
2003-05-19 21:24 bangerth
2003-05-20  3:06 Giovanni Bajo
2003-05-20 13:16 Wolfgang Bangerth

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=20030519163309.24353.qmail@sources.redhat.com \
    --to=llewins@raytheon.com \
    --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).