diff options
Diffstat (limited to 'clang/lib/Sema/SemaInit.cpp')
-rw-r--r-- | clang/lib/Sema/SemaInit.cpp | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp index efe2d03..a1e4bb4 100644 --- a/clang/lib/Sema/SemaInit.cpp +++ b/clang/lib/Sema/SemaInit.cpp @@ -7740,27 +7740,11 @@ ExprResult InitializationSequence::Perform(Sema &S, // introduced and such). So, we fall back to making the array // type a dependently-sized array type with no specified // bound. - if (isa<InitListExpr>((Expr *)Args[0])) { - SourceRange Brackets; - - // Scavange the location of the brackets from the entity, if we can. - if (auto *DD = dyn_cast_or_null<DeclaratorDecl>(Entity.getDecl())) { - if (TypeSourceInfo *TInfo = DD->getTypeSourceInfo()) { - TypeLoc TL = TInfo->getTypeLoc(); - if (IncompleteArrayTypeLoc ArrayLoc = - TL.getAs<IncompleteArrayTypeLoc>()) - Brackets = ArrayLoc.getBracketsRange(); - } - } - - *ResultType - = S.Context.getDependentSizedArrayType(ArrayT->getElementType(), - /*NumElts=*/nullptr, - ArrayT->getSizeModifier(), - ArrayT->getIndexTypeCVRQualifiers(), - Brackets); - } - + if (isa<InitListExpr>((Expr *)Args[0])) + *ResultType = S.Context.getDependentSizedArrayType( + ArrayT->getElementType(), + /*NumElts=*/nullptr, ArrayT->getSizeModifier(), + ArrayT->getIndexTypeCVRQualifiers()); } } if (Kind.getKind() == InitializationKind::IK_Direct && |