Browse Source

Fixed wrong dependent checking for some types causing mangler crash.

Consider the following sample code:

template <typename T>
class MyClass
{
    int i;
};

Even though `i` is not a dependent type itself it needs to be considered as dependent for name mangling purposes.

Fixes a boost parser crasher.
pull/553/head
triton 10 years ago
parent
commit
24bdec82b2
  1. 5
      src/CppParser/Parser.cpp

5
src/CppParser/Parser.cpp

@ -330,7 +330,10 @@ std::string Parser::GetDeclMangledName(clang::Decl* D, clang::TargetCXXABI ABI, @@ -330,7 +330,10 @@ std::string Parser::GetDeclMangledName(clang::Decl* D, clang::TargetCXXABI ABI,
llvm::raw_string_ostream Out(Mangled);
if (const ValueDecl *VD = dyn_cast<ValueDecl>(ND))
IsDependent = VD->getType()->isDependentType();
IsDependent |= VD->getType()->isDependentType();
if (!IsDependent)
IsDependent |= ND->getDeclContext()->isDependentContext();
if (!MC->shouldMangleDeclName(ND) || IsDependent)
return ND->getDeclName().getAsString();

Loading…
Cancel
Save