c++/7303: Internal error #75 -- typedef + templates + typeof

een@cs.chalmers.se een@cs.chalmers.se
Sun Jul 14 01:46:00 GMT 2002


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



More information about the Gcc-prs mailing list