Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Issue with resolving STL classes


      I have an issue with resolving some of the STL classes like vector<>.
In stl_vector.h file we have vector<> under the namespace "_GLIBCXX_STD".
This name is #defined in c++config.h file as std  ---->     # define

I have two scenarios here:

1.    In some cases, while working with IC element of this vector<> class,
we get the fully qualified name of this class as std::vector and also I get
the path of the file containing the declaration (here, stl_vector.h).  As
part of my processing I need to get more information out of this, so I get
the AST TranslationUnit of the file and search the vector<> declaration.
Here I am not able to find the declaration. This AST TU has the vector as
_GLIBCXX_STD::vector and not as std::vector.

2.    In one of the processing I have to resolve the type of attributes in
a CPP file. This type may be a STL class. Now, if its a vector<> class and
if I try to the resolve the binding, I get a PDOM object and its
fullyscoped name comes as std::vector. I store this information with me
along with the file path that contains its declaration(here, stl_vector.h).
Later, when I require to resolve the same, I create a ASTTranslationUnit by
passing the above file path and try to find the declaration. Here, I am not
able to find the declaration of vector<>. This AST TranslationUnit has
vector as _GLIBCXX_STD::vector and not std::vector.

      Is there a way to convert the _GLIBCXX_STD to std or viceversa?  Or
any other suggestions to solve this problem.

      I get the ASTTranslationUnit by calling

                  IASTTranslationUnit tu = ictu.getAST(null,
ITranslationUnit.AST_SKIP_ALL_HEADERS);   // ictu is ITranslationUnit

      I am working with CDT 5.0.


Back to the top