Browse Source

Fixed parsing of preprocessed entities for parameter declarations.

Clang reports a wrong source range for function parameters and since we already process them specially we should not process them in HandleDeclaration too, else we get duplicated entities.
pull/169/head
triton 12 years ago
parent
commit
82d6d609b4
  1. 4
      src/CppParser/Parser.cpp
  2. 4
      src/Parser/Parser.cpp

4
src/CppParser/Parser.cpp

@ -2133,6 +2133,10 @@ void Parser::HandleDeclaration(clang::Decl* D, Declaration* Decl) @@ -2133,6 +2133,10 @@ void Parser::HandleDeclaration(clang::Decl* D, Declaration* Decl)
{
HandlePreprocessedEntities(Decl);
}
else if (clang::dyn_cast<clang::ParmVarDecl>(D))
{
// Ignore function parameters as we already walk their preprocessed entities.
}
else
{
auto startLoc = GetDeclStartLocation(C.get(), D);

4
src/Parser/Parser.cpp

@ -2157,6 +2157,10 @@ void Parser::HandleDeclaration(clang::Decl* D, CppSharp::AST::Declaration^ Decl) @@ -2157,6 +2157,10 @@ void Parser::HandleDeclaration(clang::Decl* D, CppSharp::AST::Declaration^ Decl)
{
HandlePreprocessedEntities(Decl);
}
else if (clang::dyn_cast<clang::ParmVarDecl>(D))
{
// Ignore function parameters as we already walk their preprocessed entities.
}
else
{
auto startLoc = GetDeclStartLocation(C.get(), D);

Loading…
Cancel
Save