Commit b76219b5 authored by Bill Wendling's avatar Bill Wendling
Browse files

[clang][Sema] Use correct array size for diagnostic

The diagnostic was confusing and reporting that an array contains far
more elements than it is defined to have, due to casting.

For example, this code:

  double foo[4096];
  ((char*)foo)[sizeof(foo)];

warns that the "index 32768 is past the end of the array (which contains
32768 elements)."

Reviewed By: serge-sans-paille, aaron.ballman

Differential Revision: https://reviews.llvm.org/D135920
parent 98954470
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment