https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91899

--- Comment #4 from Antony Polukhin <antoshkka at gmail dot com> ---
(In reply to Alexander Monakov from comment #3)
> unless the compiler somehow proves that overlap is not
> observable?

Oh, now I see. Here's a valid example:

static const char data1[] = "test";
static const char data2[] = "test test";
char lookup1(int i) { return data1[i]; }
char lookup2(int i) { return data2[i]; }


data1/2 are internal linkage symbols and pointers to them or their content are
not returned or passed to any other function. So the overlap is not observable.

The above case could be found in std::to_chars, where different internal
functions have overlapping `static constexpr char __digits[]` arrays.

Reply via email to