Skip to content

Commit 721bdc0

Browse files
committed
minor improvements
1 parent 89525ac commit 721bdc0

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5678,32 +5678,33 @@ static std::pair<Expr *, int>
56785678
makeClusterDimsArgExpr(Sema &S, Expr *E, const CUDAClusterDimsAttr &AL,
56795679
const unsigned Idx) {
56805680
if (S.DiagnoseUnexpandedParameterPack(E))
5681-
return {nullptr, 0};
5681+
return {};
56825682

56835683
// Accept template arguments for now as they depend on something else.
56845684
// We'll get to check them when they eventually get instantiated.
56855685
if (E->isInstantiationDependent())
5686-
return {E, 1};
5686+
return {};
56875687

56885688
std::optional<llvm::APSInt> I = E->getIntegerConstantExpr(S.Context);
56895689
if (!I) {
56905690
S.Diag(E->getExprLoc(), diag::err_attribute_argument_n_type)
56915691
<< &AL << Idx << AANT_ArgumentIntegerConstant << E->getSourceRange();
5692-
return {nullptr, 0};
5692+
return {};
56935693
}
56945694
// Make sure we can fit it in 4 bits.
56955695
if (!I->isIntN(4)) {
56965696
S.Diag(E->getExprLoc(), diag::err_ice_too_large)
5697-
<< toString(*I, 10, false) << 4 << /* Unsigned */ 1;
5698-
return {nullptr, 0};
5697+
<< toString(*I, 10, false) << 4 << /*Unsigned=*/1;
5698+
return {};
56995699
}
5700-
if (*I < 0)
5700+
if (*I < 0) {
57015701
S.Diag(E->getExprLoc(), diag::warn_attribute_argument_n_negative)
57025702
<< &AL << Idx << E->getSourceRange();
5703+
}
57035704

57045705
// We may need to perform implicit conversion of the argument.
57055706
InitializedEntity Entity = InitializedEntity::InitializeParameter(
5706-
S.Context, S.Context.getConstType(S.Context.IntTy), /*consume*/ false);
5707+
S.Context, S.Context.getConstType(S.Context.IntTy), /*consume=*/false);
57075708
ExprResult ValArg = S.PerformCopyInitialization(Entity, SourceLocation(), E);
57085709
assert(!ValArg.isInvalid() &&
57095710
"Unexpected PerformCopyInitialization() failure.");

0 commit comments

Comments
 (0)