Browse Source

Parser.cpp: implement CXXDeductionGuide

pull/1819/head
Deadlocklogic 3 years ago
parent
commit
bc06a0d615
  1. 15
      src/CppParser/Parser.cpp

15
src/CppParser/Parser.cpp

@ -1622,6 +1622,10 @@ FunctionTemplate* Parser::WalkFunctionTemplate(const clang::FunctionTemplateDecl @@ -1622,6 +1622,10 @@ FunctionTemplate* Parser::WalkFunctionTemplate(const clang::FunctionTemplateDecl
using namespace clang;
auto TemplatedDecl = TD->getTemplatedDecl();
if (dyn_cast<CXXDeductionGuideDecl>(TemplatedDecl))
return nullptr;
auto NS = GetNamespace(TD);
assert(NS && "Expected a valid namespace");
@ -1631,7 +1635,6 @@ FunctionTemplate* Parser::WalkFunctionTemplate(const clang::FunctionTemplateDecl @@ -1631,7 +1635,6 @@ FunctionTemplate* Parser::WalkFunctionTemplate(const clang::FunctionTemplateDecl
return FT;
CppSharp::CppParser::AST::Function* F = nullptr;
auto TemplatedDecl = TD->getTemplatedDecl();
if (auto MD = dyn_cast<CXXMethodDecl>(TemplatedDecl))
F = WalkMethodCXX(MD);
@ -2929,6 +2932,15 @@ Type* Parser::WalkType(clang::QualType QualType, const clang::TypeLoc* TL, @@ -2929,6 +2932,15 @@ Type* Parser::WalkType(clang::QualType QualType, const clang::TypeLoc* TL,
Ty = WalkType(MT->getUnderlyingType(), TL);
break;
}
case clang::Type::DeducedTemplateSpecialization:
{
auto DTS = Type->getAs<clang::DeducedTemplateSpecializationType>();
if (DTS->isSugared())
Ty = WalkType(DTS->getCanonicalTypeInternal());
else
return nullptr;
break;
}
default:
{
Debug("Unhandled type class '%s'\n", Type->getTypeClassName());
@ -4276,6 +4288,7 @@ Declaration* Parser::WalkDeclaration(const clang::Decl* D) @@ -4276,6 +4288,7 @@ Declaration* Parser::WalkDeclaration(const clang::Decl* D)
case Decl::IndirectField:
case Decl::StaticAssert:
case Decl::NamespaceAlias:
case Decl::CXXDeductionGuide:
break;
default:
{

Loading…
Cancel
Save