public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: een@cs.chalmers.se
To: gcc-gnats@gcc.gnu.org
Subject: c++/7303: Internal error #75 -- typedef + templates + typeof
Date: Sun, 14 Jul 2002 01:46:00 -0000	[thread overview]
Message-ID: <20020714083802.3907.qmail@sources.redhat.com> (raw)


>Number:         7303
>Category:       c++
>Synopsis:       Internal error #75 -- typedef + templates + typeof
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 14 01:46:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Niklas Een
>Release:        gcc version 2.96 20000731
>Organization:
>Environment:

>Description:
Doing meta programming without __if_exists (as in VC, when
are you going to add it?) takes clever tricks. The only
solution I could come up with results in internal compiler
error :-(. Here is a minimal program that causes the bug:

struct A { int x; };

template <class T> struct B {
    typedef typeof(T().x)   y;
};

int main(void) {
    B<A>    dummy;
    return 0;
}
>How-To-Repeat:
Just compile the above lines.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="bug.C"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="bug.C"

c3RydWN0IEEgewogICAgaW50ICAgICB4Owp9OwoKCnRlbXBsYXRlIDxjbGFzcyBUPgpzdHJ1Y3Qg
QiB7CiAgICB0eXBlZGVmIHR5cGVvZihUKCkueCkgICB5Owp9OwoKCgppbnQgbWFpbih2b2lkKQp7
CiAgICBCPEE+ICAgIGR1bW15OwoKICAgIHJldHVybiAwOwp9Cg==


             reply	other threads:[~2002-07-14  8:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-14  1:46 een [this message]
2002-07-14  2:21 aj

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=20020714083802.3907.qmail@sources.redhat.com \
    --to=een@cs.chalmers.se \
    --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).