MantisBT - GCC-XML
View Issue Details
0013372GCC-XML(No Category)public2012-07-03 09:222012-07-26 10:36
Chris Green 
Brad King 
normalminoralways
resolvedfixed 
x86_64Scientific Linux (based on RHEL)6.1
0013372: gccxml cannot parse <limits> under GCC 4.7.1
An attempt to parse a header which includes <limits> under GCC 4.7.1 gives the following problem:

------------------------------------------------------------------------
/mnt/disk1/products/gcc/v4_7_1/Linux64bit+2.6-2.12/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/limits:1405: error: '__int128' was not declared in this scope
/mnt/disk1/products/gcc/v4_7_1/Linux64bit+2.6-2.12/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/limits:1405: error: template argument 1 is invalid
/mnt/disk1/products/gcc/v4_7_1/Linux64bit+2.6-2.12/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/limits:1479: error: template argument 1 is invalid
------------------------------------------------------------------------
Make a file gccxml_test.h containing:
------------------------------------------------------------------------
#include <limits>
struct MyClass {
  int fred;
};
------------------------------------------------------------------------
Attempt to parse with:
gccxml gccxml_test.h
Error can be made to go away by defining __STRICT_ANSI__, but not sure if this causes other problems.

Verified with HEAD downloaded 2012/07/02, compiled with GCC 4.7.1.
No tags attached.
related to 0012932closed Brad King gccxml lacks support for gcc 4.7 
Issue History
2012-07-03 09:22Chris GreenNew Issue
2012-07-26 08:02Brad KingRelationship addedrelated to 0012932
2012-07-26 10:36Brad KingNote Added: 0030128
2012-07-26 10:36Brad KingStatusnew => resolved
2012-07-26 10:36Brad KingResolutionopen => fixed
2012-07-26 10:36Brad KingAssigned To => Brad King

Notes
(0030128)
Brad King   
2012-07-26 10:36   
We simply need to disable __int128 in the libstdc++ configuration by overriding bits/c++config.h as follows:

$ cat GCC_XML/Support/GCC/4.7/bits/c++config.h
#include_next <bits/c++config.h>
/* GCC 4.2 parser does not support __int128 */
#undef _GLIBCXX_USE_INT128

/cvsroot/GCC_XML/gccxml/GCC_XML/Support/GCC/4.7/bits/c++config.h,v <-- c++config.h
initial revision: 1.1