Skip to content

Commit b6fea11

Browse files
committed
fix an error
1 parent 721bdc0 commit b6fea11

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5683,7 +5683,7 @@ makeClusterDimsArgExpr(Sema &S, Expr *E, const CUDAClusterDimsAttr &AL,
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 {};
5686+
return {E, 1};
56875687

56885688
std::optional<llvm::APSInt> I = E->getIntegerConstantExpr(S.Context);
56895689
if (!I) {
@@ -5702,14 +5702,8 @@ makeClusterDimsArgExpr(Sema &S, Expr *E, const CUDAClusterDimsAttr &AL,
57025702
<< &AL << Idx << E->getSourceRange();
57035703
}
57045704

5705-
// We may need to perform implicit conversion of the argument.
5706-
InitializedEntity Entity = InitializedEntity::InitializeParameter(
5707-
S.Context, S.Context.getConstType(S.Context.IntTy), /*consume=*/false);
5708-
ExprResult ValArg = S.PerformCopyInitialization(Entity, SourceLocation(), E);
5709-
assert(!ValArg.isInvalid() &&
5710-
"Unexpected PerformCopyInitialization() failure.");
5711-
5712-
return {ValArg.getAs<Expr>(), I->getZExtValue()};
5705+
return {ConstantExpr::Create(S.getASTContext(), E, APValue(*I)),
5706+
I->getZExtValue()};
57135707
}
57145708

57155709
CUDAClusterDimsAttr *Sema::createClusterDimsAttr(const AttributeCommonInfo &CI,

0 commit comments

Comments
 (0)