Skip to content

Commit e1f3fa6

Browse files
committed
Only remove 1 level of array indirection
1 parent 014a603 commit e1f3fa6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

clang/lib/Sema/SemaOpenACC.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3006,8 +3006,10 @@ bool SemaOpenACC::CreateReductionCombinerRecipe(
30063006

30073007
// If VarTy is an array type, at the top level only, we want to do our
30083008
// compares/decomp/etc at the element level.
3009-
if (VarTy->isArrayType())
3010-
VarTy = QualType{VarTy->getPointeeOrArrayElementType(), 0};
3009+
if (auto *AT = getASTContext().getAsArrayType(VarTy))
3010+
VarTy = AT->getElementType();
3011+
3012+
assert(!VarTy->isArrayType() && "Only 1 level of array allowed");
30113013

30123014
auto tryCombiner = [&, this](DeclRefExpr *LHSDRE, DeclRefExpr *RHSDRE,
30133015
bool IncludeTrap) {

0 commit comments

Comments
 (0)