Skip to content

Commit e5430cb

Browse files
committed
Address Comments
1 parent e58c0ae commit e5430cb

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ Bug Fixes in This Version
253253
-------------------------
254254
- Fix a crash when marco name is empty in ``#pragma push_macro("")`` or
255255
``#pragma pop_macro("")``. (#GH149762).
256-
- Fix a crash in variable length array (e.g. int a[*]) function parameter type
257-
being used in `_Countof` expression. (#GH152826)
256+
- Fix a crash in variable length array (e.g. ``int a[*]``) function parameter type
257+
being used in ``_Countof`` expression. (#GH152826)
258258
- `-Wunreachable-code`` now diagnoses tautological or contradictory
259259
comparisons such as ``x != 0 || x != 1.0`` and ``x == 0 && x == 1.0`` on
260260
targets that treat ``_Float16``/``__fp16`` as native scalar types. Previously

clang/lib/AST/ExprConstant.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15354,7 +15354,7 @@ bool IntExprEvaluator::VisitUnaryExprOrTypeTraitExpr(
1535415354
assert(VAT);
1535515355
if (VAT->getElementType()->isArrayType()) {
1535615356
// Variable array size expression could be missing (e.g. int a[*][10]) In
15357-
// that case, it can't be a constant expression
15357+
// that case, it can't be a constant expression.
1535815358
if (!VAT->getSizeExpr()) {
1535915359
Info.FFDiag(E->getBeginLoc());
1536015360
return false;
@@ -17898,7 +17898,7 @@ static ICEDiag CheckICE(const Expr* E, const ASTContext &Ctx) {
1789817898
const auto *VAT = Ctx.getAsVariableArrayType(ArgTy);
1789917899
if (VAT->getElementType()->isArrayType())
1790017900
// Variable array size expression could be missing (e.g. int a[*][10])
17901-
// In that case, it can't be a constant expression
17901+
// In that case, it can't be a constant expression.
1790217902
return VAT->getSizeExpr() ? CheckICE(VAT->getSizeExpr(), Ctx)
1790317903
: ICEDiag(IK_NotICE, E->getBeginLoc());
1790417904

clang/test/Sema/gh152826.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44

55
void gh152826(char (*a)[*][5], int (*x)[_Countof (*a)]);
66
void more_likely_in_practice(unsigned long size_one, int (*a)[*][5], int b[_Countof(*a)]);
7+
void f(int (*x)[*][1][*][2][*][*][3][*], int q[_Countof(*x)]);

0 commit comments

Comments
 (0)