aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaOpenACC.cpp11
-rw-r--r--clang/lib/Sema/SemaTemplateDeductionGuide.cpp19
2 files changed, 12 insertions, 18 deletions
diff --git a/clang/lib/Sema/SemaOpenACC.cpp b/clang/lib/Sema/SemaOpenACC.cpp
index 9aaf7f4..7ad7049 100644
--- a/clang/lib/Sema/SemaOpenACC.cpp
+++ b/clang/lib/Sema/SemaOpenACC.cpp
@@ -2894,17 +2894,18 @@ SemaOpenACC::CreateFirstPrivateInitRecipe(const Expr *VarExpr) {
OpenACCReductionRecipe SemaOpenACC::CreateReductionInitRecipe(
OpenACCReductionOperator ReductionOperator, const Expr *VarExpr) {
- // TODO: OpenACC: This shouldn't be necessary, see PrivateInitRecipe
- VarExpr = StripOffBounds(VarExpr);
-
+ // We don't strip bounds here, so that we are doing our recipe init at the
+ // 'lowest' possible level. Codegen is going to have to do its own 'looping'.
if (!VarExpr || VarExpr->getType()->isDependentType())
return OpenACCReductionRecipe::Empty();
QualType VarTy =
VarExpr->getType().getNonReferenceType().getUnqualifiedType();
- // TODO: OpenACC: for arrays/bounds versions, we're going to have to do a
- // different initializer, but for now we can go ahead with this.
+ // Array sections are special, and we have to treat them that way.
+ if (const auto *ASE =
+ dyn_cast<ArraySectionExpr>(VarExpr->IgnoreParenImpCasts()))
+ VarTy = ArraySectionExpr::getBaseOriginalType(ASE);
VarDecl *AllocaDecl = CreateAllocaDecl(
getASTContext(), SemaRef.getCurContext(), VarExpr->getBeginLoc(),
diff --git a/clang/lib/Sema/SemaTemplateDeductionGuide.cpp b/clang/lib/Sema/SemaTemplateDeductionGuide.cpp
index 9a61888..8ba23aa 100644
--- a/clang/lib/Sema/SemaTemplateDeductionGuide.cpp
+++ b/clang/lib/Sema/SemaTemplateDeductionGuide.cpp
@@ -1189,14 +1189,13 @@ BuildDeductionGuideForTypeAlias(Sema &SemaRef,
// parameter list of a synthesized CTAD guide. See also the FIXME in
// test/SemaCXX/cxx20-ctad-type-alias.cpp:test25.
Sema::CheckTemplateArgumentInfo CTAI;
+ for (auto TA : Output.arguments())
+ if (SemaRef.CheckTemplateArgument(
+ TP, TA, F, F->getLocation(), F->getLocation(),
+ /*ArgumentPackIndex=*/-1, CTAI,
+ Sema::CheckTemplateArgumentKind::CTAK_Specified))
+ return nullptr;
if (Input.getArgument().getKind() == TemplateArgument::Pack) {
- for (auto TA : Output.arguments()) {
- if (SemaRef.CheckTemplateArgument(
- TP, TA, F, F->getLocation(), F->getLocation(),
- /*ArgumentPackIndex=*/-1, CTAI,
- Sema::CheckTemplateArgumentKind::CTAK_Specified))
- return nullptr;
- }
// We will substitute the non-deduced template arguments with these
// transformed (unpacked at this point) arguments, where that substitution
// requires a pack for the corresponding parameter packs.
@@ -1204,12 +1203,6 @@ BuildDeductionGuideForTypeAlias(Sema &SemaRef,
TemplateArgument::CreatePackCopy(Context, CTAI.SugaredConverted);
} else {
assert(Output.arguments().size() == 1);
- TemplateArgumentLoc Transformed = Output.arguments()[0];
- if (SemaRef.CheckTemplateArgument(
- TP, Transformed, F, F->getLocation(), F->getLocation(),
- /*ArgumentPackIndex=*/-1, CTAI,
- Sema::CheckTemplateArgumentKind::CTAK_Specified))
- return nullptr;
TemplateArgsForBuildingFPrime[Index] = CTAI.SugaredConverted[0];
}
}