https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65398
Bug ID: 65398 Summary: [C++11] GCC rejects constexpr variable definitions with valid initialization Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: kariya_mitsuru at hotmail dot com Created attachment 35017 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35017&action=edit g++ -v The sample code below should be compiled successfully but gcc 5.0 rejects it. ================= sample code ================= constexpr char s[] = "abc"; constexpr char c = *(&s[0] + 1); int main() {} ================= sample code ================= cf. http://melpon.org/wandbox/permlink/jRbgl6YCTXHSspI9 Note that gcc 4.9.2 accepts it. cf. http://melpon.org/wandbox/permlink/bwuaSYUvgwAjRTfo Note also that gcc 5.0 accepts if "&s[0]" is replaced with "s". ================= sample code ================= constexpr char s[] = "abc"; constexpr char c = *(s + 1); int main() {} ================= sample code ================= cf. http://melpon.org/wandbox/permlink/sy0THyfnSq6XCT0L