Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 786 Bytes

File metadata and controls

29 lines (22 loc) · 786 Bytes
title C26483
ms.date 03/22/2018
ms.topic reference
f1_keywords
C26483
helpviewer_keywords
C26483
description CppCoreCheck rule C26483 that enforces C++ Core Guidelines Bounds.2

C26483 STATIC_INDEX_OUT_OF_RANGE

Value %value% is outside the bounds (0, %bound%) of variable '%variable%'. Only index into arrays using constant expressions that are within bounds of the array (bounds.2).

See also

C++ Core Guidelines Bounds.2

Example

void function()
{
    std::array<int, 3> arr1 { 1, 2, 3 };
    arr1[3] = 4; // C26483, 3 is outside the bounds of the array

    int arr2[] { 1, 2, 3 };
    arr2[3] = 4; // C26483, 3 is outside the bounds of the array
}