MantisBT - GCC-XML
View Issue Details
0012158GCC-XML(No Category)public2011-05-05 07:582011-05-06 07:55
Sylvain Joyeux 
Brad King 
normalmajoralways
closedfixed 
GNU/LinuxDebiansid
0012158: GCCXML chokes on GCC 4.6 <complex>: "cannot convert float to float __complex__"
gccxml version 0.9.0+cvs20110222-1 chokes on GCC 4.6 <complex> header
The errors are

In file included from test.cpp:1:
/usr/include/c++/4.6/complex: In member function 'std::complex<float>& std::complex<float>::operator=(float)':
/usr/include/c++/4.6/complex:1087: error: cannot convert 'float' to 'float __complex__' in assignment
/usr/include/c++/4.6/complex: In member function 'std::complex<double>& std::complex<double>::operator=(double)':
/usr/include/c++/4.6/complex:1229: error: cannot convert 'double' to 'double __complex__' in assignment
/usr/include/c++/4.6/complex: In member function 'std::complex<long double>& std::complex<long double>::operator=(long double)':
/usr/include/c++/4.6/complex:1372: error: cannot convert 'long double' to 'long double __complex__' in assignment
[~]% cat test.cpp
#include <complex>

[~]% gccxml test.cpp
No tags attached.
? complex (51,959) 2011-05-05 23:33
https://public.kitware.com/Bug/file/3854/complex
Issue History
2011-05-05 07:58Sylvain JoyeuxNew Issue
2011-05-05 08:09Brad KingNote Added: 0026439
2011-05-05 23:33Christofer BertonhaNote Added: 0026442
2011-05-05 23:33Christofer BertonhaFile Added: complex
2011-05-06 07:54Brad KingAssigned To => Brad King
2011-05-06 07:54Brad KingStatusnew => assigned
2011-05-06 07:55Brad KingNote Added: 0026443
2011-05-06 07:55Brad KingStatusassigned => closed
2011-05-06 07:55Brad KingResolutionopen => fixed

Notes
(0026439)
Brad King   
2011-05-05 08:09   
Copy the header to Support/GCC/4.6 and modify it to avoid the error. You can probably just remove the implementation of the method and leave only the declaration behind (since gccxml only cares about the interface). Then please attach a copy of the original and modified headers to this issue so we can commit the fix upstream.
(0026442)
Christofer Bertonha   
2011-05-05 23:33   
I upload a complex that resolve the problem, I just remove the implementation of 3 methods where it's affects
(0026443)
Brad King   
2011-05-06 07:55   
Great, thanks for providing/testing that. Applied:

Fix GCC 4.6 <complex> header to work with GCC 4.2 parser (0012158)
/cvsroot/GCC_XML/gccxml/GCC_XML/Support/GCC/4.6/complex,v <-- complex
new revision: 1.2; previous revision: 1.1