Browse Source

Do not add template functions to the namespace as regular functions.

pull/1/head
triton 13 years ago
parent
commit
1dadc9692a
  1. 8
      src/Parser/Parser.cpp
  2. 3
      src/Parser/Parser.h

8
src/Parser/Parser.cpp

@ -431,7 +431,8 @@ Cxxi::FunctionTemplate^ Parser::WalkFunctionTemplate(clang::FunctionTemplateDecl @@ -431,7 +431,8 @@ Cxxi::FunctionTemplate^ Parser::WalkFunctionTemplate(clang::FunctionTemplateDecl
auto NS = GetNamespace(TD);
auto Function = WalkFunction(TD->getTemplatedDecl(), /*IsDependent=*/true);
auto Function = WalkFunction(TD->getTemplatedDecl(), /*IsDependent=*/true,
/*AddToNamespace=*/false);
Cxxi::FunctionTemplate^ FT = gcnew Cxxi::FunctionTemplate(Function);
return FT;
@ -1055,7 +1056,8 @@ void Parser::WalkFunction(clang::FunctionDecl* FD, Cxxi::Function^ F, @@ -1055,7 +1056,8 @@ void Parser::WalkFunction(clang::FunctionDecl* FD, Cxxi::Function^ F,
}
}
Cxxi::Function^ Parser::WalkFunction(clang::FunctionDecl* FD, bool IsDependent)
Cxxi::Function^ Parser::WalkFunction(clang::FunctionDecl* FD, bool IsDependent,
bool AddToNamespace)
{
using namespace clang;
using namespace clix;
@ -1071,6 +1073,8 @@ Cxxi::Function^ Parser::WalkFunction(clang::FunctionDecl* FD, bool IsDependent) @@ -1071,6 +1073,8 @@ Cxxi::Function^ Parser::WalkFunction(clang::FunctionDecl* FD, bool IsDependent)
F = gcnew Cxxi::Function();
WalkFunction(FD, F, IsDependent);
if (AddToNamespace)
NS->Functions->Add(F);
return F;

3
src/Parser/Parser.h

@ -96,7 +96,8 @@ protected: @@ -96,7 +96,8 @@ protected:
bool IgnoreSystemDecls = true, bool CanBeDefinition = false);
Cxxi::Declaration^ WalkDeclarationDef(clang::Decl* D);
Cxxi::Enumeration^ WalkEnum(clang::EnumDecl*);
Cxxi::Function^ WalkFunction(clang::FunctionDecl*, bool IsDependent = false);
Cxxi::Function^ WalkFunction(clang::FunctionDecl*, bool IsDependent = false,
bool AddToNamespace = true);
Cxxi::Class^ WalkRecordCXX(clang::CXXRecordDecl*, bool IsDependent = false);
Cxxi::Method^ WalkMethodCXX(clang::CXXMethodDecl*);
Cxxi::Field^ WalkFieldCXX(clang::FieldDecl*, Cxxi::Class^);

Loading…
Cancel
Save