Skip to content

Commit 18351d7

Browse files
committed
update err_typecheck_subscript_not_integer to indicate array or matrix
1 parent 48d63d3 commit 18351d7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clang/lib/Sema/SemaExpr.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5334,6 +5334,7 @@ Sema::CreateBuiltinArraySubscriptExpr(Expr *Base, SourceLocation LLoc,
53345334
// C99 6.5.2.1p1
53355335
if (!IndexExpr->getType()->isIntegerType() && !IndexExpr->isTypeDependent())
53365336
return ExprError(Diag(LLoc, diag::err_typecheck_subscript_not_integer)
5337+
<< /*array*/ 0
53375338
<< IndexExpr->getSourceRange());
53385339

53395340
if ((IndexExpr->getType()->isSpecificBuiltinType(BuiltinType::Char_S) ||
@@ -16261,6 +16262,7 @@ ExprResult Sema::BuildBuiltinOffsetOf(SourceLocation BuiltinLoc,
1626116262
!Idx->getType()->isIntegerType())
1626216263
return ExprError(
1626316264
Diag(Idx->getBeginLoc(), diag::err_typecheck_subscript_not_integer)
16265+
<< /*array*/ 0
1626416266
<< Idx->getSourceRange());
1626516267

1626616268
// Record this array index.

0 commit comments

Comments
 (0)