diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -15447,7 +15447,7 @@ const Type *BaseType = ArrayTy == nullptr ? nullptr : ArrayTy->getElementType().getTypePtr(); bool IsUnboundedArray = (BaseType == nullptr); - if (EffectiveType->isDependentType() || + if (EffectiveType->isDependentType() || EffectiveType->isFunctionType() || (!IsUnboundedArray && BaseType->isDependentType())) return; diff --git a/clang/test/Sema/unbounded-array-bounds.c b/clang/test/Sema/unbounded-array-bounds.c --- a/clang/test/Sema/unbounded-array-bounds.c +++ b/clang/test/Sema/unbounded-array-bounds.c @@ -80,3 +80,7 @@ (void *)0 + 0xdead000000000000UL; // no array-bounds warning, and no crash } + +void func() { + func + 0xdead000000000000UL; // no crash +}