Quick fix for 325116 buildbots: move template specialization into namespace

llvm-svn: 325118
This commit is contained in:
Aleksei Sidorin 2018-02-14 11:39:33 +00:00
parent 8d9acc5342
commit 782bfcfd0c
1 changed files with 29 additions and 27 deletions

View File

@ -360,8 +360,37 @@ namespace clang {
// Importing overrides.
void ImportOverrides(CXXMethodDecl *ToMethod, CXXMethodDecl *FromMethod);
};
template <typename InContainerTy>
bool ASTNodeImporter::ImportTemplateArgumentListInfo(
SourceLocation FromLAngleLoc, SourceLocation FromRAngleLoc,
const InContainerTy &Container, TemplateArgumentListInfo &Result) {
TemplateArgumentListInfo ToTAInfo(Importer.Import(FromLAngleLoc),
Importer.Import(FromRAngleLoc));
if (ImportTemplateArgumentListInfo(Container, ToTAInfo))
return true;
Result = ToTAInfo;
return false;
}
template <>
bool ASTNodeImporter::ImportTemplateArgumentListInfo<TemplateArgumentListInfo>(
const TemplateArgumentListInfo &From, TemplateArgumentListInfo &Result) {
return ImportTemplateArgumentListInfo(
From.getLAngleLoc(), From.getRAngleLoc(), From.arguments(), Result);
}
template <>
bool ASTNodeImporter::ImportTemplateArgumentListInfo<
ASTTemplateArgumentListInfo>(const ASTTemplateArgumentListInfo &From,
TemplateArgumentListInfo &Result) {
return ImportTemplateArgumentListInfo(From.LAngleLoc, From.RAngleLoc,
From.arguments(), Result);
}
} // end namespace clang
//----------------------------------------------------------------------------
// Import Types
//----------------------------------------------------------------------------
@ -1322,33 +1351,6 @@ bool ASTNodeImporter::ImportTemplateArgumentListInfo(
return false;
}
template <typename InContainerTy>
bool ASTNodeImporter::ImportTemplateArgumentListInfo(
SourceLocation FromLAngleLoc, SourceLocation FromRAngleLoc,
const InContainerTy &Container, TemplateArgumentListInfo &Result) {
TemplateArgumentListInfo ToTAInfo(Importer.Import(FromLAngleLoc),
Importer.Import(FromRAngleLoc));
if (ImportTemplateArgumentListInfo(Container, ToTAInfo))
return true;
Result = ToTAInfo;
return false;
}
template <>
bool ASTNodeImporter::ImportTemplateArgumentListInfo<TemplateArgumentListInfo>(
const TemplateArgumentListInfo &From, TemplateArgumentListInfo &Result) {
return ImportTemplateArgumentListInfo(
From.getLAngleLoc(), From.getRAngleLoc(), From.arguments(), Result);
}
template <>
bool ASTNodeImporter::ImportTemplateArgumentListInfo<
ASTTemplateArgumentListInfo>(const ASTTemplateArgumentListInfo &From,
TemplateArgumentListInfo &Result) {
return ImportTemplateArgumentListInfo(From.LAngleLoc, From.RAngleLoc,
From.arguments(), Result);
}
bool ASTNodeImporter::IsStructuralMatch(RecordDecl *FromRecord,
RecordDecl *ToRecord, bool Complain) {
// Eliminate a potential failure point where we attempt to re-import