Bug 40814 - internal compiler error: in digest_init, at cp/typeck2.c:709
Summary: internal compiler error: in digest_init, at cp/typeck2.c:709
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.1.0
: P3 minor
Target Milestone: 4.1.2
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-21 06:40 UTC by cb
Modified: 2009-07-21 09:31 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
preprocessor output (I guess) (90.70 KB, text/plain)
2009-07-21 06:43 UTC, cb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cb 2009-07-21 06:40:59 UTC
I stumbled upon this very unusual error. I don't know if it's worth investigating, since I'm note even sure that this is legal code:

Anyway, GCC says:

test.cpp:8: internal compiler error: in digest_init, at cp/typeck2.c:709
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccxi24ed.out file, please attach this to your bugreport.

---------------------------
here is the offending code:
---------------------------

#include <iostream>
using namespace std;

void paperino() { cout << __FUNCTION__ << endl; }
void pippo() { cout << __FUNCTION__ << endl; }

template<class T> void func(const T& x) {
    T other(x);
    other();
}

int main() {
    func(paperino);
    func(&pippo);
}
Comment 1 cb 2009-07-21 06:43:20 UTC
Created attachment 18233 [details]
preprocessor output (I guess)

compiler intermediate output
Comment 2 Richard Biener 2009-07-21 09:31:55 UTC
This was fixed in GCC 4.1.2.