public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/7303: Internal error #75 -- typedef + templates + typeof
@ 2002-07-14  1:46 een
  0 siblings, 0 replies; 2+ messages in thread
From: een @ 2002-07-14  1:46 UTC (permalink / raw)
  To: gcc-gnats


>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==


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

* Re: c++/7303: Internal error #75 -- typedef + templates + typeof
@ 2002-07-14  2:21 aj
  0 siblings, 0 replies; 2+ messages in thread
From: aj @ 2002-07-14  2:21 UTC (permalink / raw)
  To: een, gcc-bugs, gcc-prs, nobody

Synopsis: Internal error #75 -- typedef + templates + typeof

State-Changed-From-To: open->closed
State-Changed-By: aj
State-Changed-When: Sun Jul 14 02:21:20 2002
State-Changed-Why:
    This is fixed in both GCC 3.1 and 3.2:
    gromit:~/tmp:[0]$ /opt/gcc/3.1-devel/bin/g++ t.C -Wall -O1
    t.C: In function `int main()':
    t.C:8: warning: unused variable `B<A> dummy'

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7303


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

end of thread, other threads:[~2002-07-14  9:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-14  1:46 c++/7303: Internal error #75 -- typedef + templates + typeof een
2002-07-14  2:21 aj

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