With a C++ file as:
extern "C" {
typedef struct {} CvImage;
extern CvImage* Cv_ImageNew(void);
}
extern void _Raytrace(CvImage* LImage);
int main(int LArgC, char** LArgV)
{
CvImage* LImage = Cv_ImageNew();
_Raytrace(LImage);
}
--- CUT --
And a C file as:
typedef struct {} CvImage;
CvImage* Cv_ImageNew(void) { }
--- CUT ---
We get an ICE when doing:
gcc -O3 -flto -r -nostdlib t0.cc t1.c
In file included from :0:0:
t0.cc: In function main:
t0.cc:6:12: error: non-trivial conversion at assignment
struct CvImage *
struct
{
} *
LImage_1 = D.1869_4(D);
t0.cc:6:12: internal compiler error: verify_stmts failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
lto-wrapper: /home/apinski/change-gcc/bin/gcc returned 1 exit status
collect2: lto-wrapper returned 1 exit status
--
Summary: Cross language don't work with unnamed structs
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: lto
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41921