Skip to content

[NFC][Sema][OpenMP] Fix free-nonheap-object warning #112942

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions clang/lib/Sema/SemaOpenMP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18335,7 +18335,8 @@ static bool checkOMPArraySectionConstantForReduction(
return false;

// This is an array subscript which has implicit length 1!
ArraySizes.push_back(llvm::APSInt::get(1));
llvm::APSInt ConstantOne = llvm::APSInt::get(1);
ArraySizes.push_back(ConstantOne);
} else {
Expr::EvalResult Result;
if (!Length->EvaluateAsInt(Result, Context))
Expand All @@ -18354,7 +18355,8 @@ static bool checkOMPArraySectionConstantForReduction(
if (!SingleElement) {
while (const auto *TempASE = dyn_cast<ArraySubscriptExpr>(Base)) {
// Has implicit length 1!
ArraySizes.push_back(llvm::APSInt::get(1));
llvm::APSInt ConstantOne = llvm::APSInt::get(1);
ArraySizes.push_back(ConstantOne);
Base = TempASE->getBase()->IgnoreParenImpCasts();
}
}
Expand Down
Loading