diff options
author | Matheus Izvekov <mizvekov@gmail.com> | 2025-04-14 10:44:25 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-14 10:44:25 -0300 |
commit | 10a15024212fe9ac06adad7daad2c1bb510a612c (patch) | |
tree | 074903792e3bf54d3d8d7bb2835ead8bbde1ddca /clang/lib/Sema/SemaInit.cpp | |
parent | 4cb1803ff9d052f1b75d90d5be87345e54aebf92 (diff) | |
download | llvm-10a15024212fe9ac06adad7daad2c1bb510a612c.zip llvm-10a15024212fe9ac06adad7daad2c1bb510a612c.tar.gz llvm-10a15024212fe9ac06adad7daad2c1bb510a612c.tar.bz2 |
[clang] AST: remove source locations from [Variable/Dependent]SizedArrayType (#135511)
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 && |