Skip to content

Commit 701800f

Browse files
committed
[ClangImporter] Handle DefaultArgument now being a TemplateArgmentLoc
This was changed in upstream LLVM 142c3f394e1b34dcefcaf0887a6fd4711b78eeb3.
1 parent 4a5e1cd commit 701800f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/AST/ClangTypeConverter.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -895,8 +895,8 @@ ClangTypeConverter::getClangTemplateArguments(
895895
auto templateParam = cast<clang::TemplateTypeParmDecl>(param);
896896
// We must have found a defaulted parameter at the end of the list.
897897
if (templateParam->getIndex() >= genericArgs.size()) {
898-
templateArgs.push_back(
899-
clang::TemplateArgument(templateParam->getDefaultArgument()));
898+
templateArgs.push_back(clang::TemplateArgument(
899+
templateParam->getDefaultArgument().getArgument()));
900900
continue;
901901
}
902902

lib/ClangImporter/ImportDecl.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -3457,8 +3457,9 @@ namespace {
34573457
// parameters when the function template is instantiated, so do not
34583458
// import the function template if the template parameter has
34593459
// dependent default value.
3460-
auto defaultArgumentType = templateTypeParam->getDefaultArgument();
3461-
if (defaultArgumentType->isDependentType())
3460+
auto &defaultArgument =
3461+
templateTypeParam->getDefaultArgument().getArgument();
3462+
if (defaultArgument.isDependent())
34623463
return nullptr;
34633464
continue;
34643465
}

0 commit comments

Comments
 (0)