BASE: Add C++11 char array initialized by a string literal test

This was not properly implemented in GCC versions before 5.1, and
we still have some ports using older GCC versions.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43453#c7 and commit
6ac3994e3e.
This commit is contained in:
Donovan Watteau 2022-10-06 13:28:20 +02:00 committed by Filippos Karapetis
parent 19514bc2ad
commit 502479d7be

View File

@ -120,6 +120,16 @@ private:
// don't do anything with i
};
#ifndef DONT_TEST_STRING_LITERAL_INIT
// ----------------------------------
// Char arrays initialized by a string literal
// * note - not properly implemented before GCC 5.1 (GCC Bug #43453)
// ----------------------------------
char _emptyMsg[1] = "";
#else
char _emptyMsg[1] = { '\0' };
#endif
#ifndef DONT_TEST_FINAL_FUNCTION
// ----------------------------------
// Non-Overridable Member Functions (final)