https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67104
--- Comment #3 from Moritz Klammler <moritz at klammler dot eu> --- Note that the following slightly modified program passes all assertions and behaves identical when compiled with either GCC or Clang. #include <array> #include <cassert> namespace /* anonymous */ { constexpr auto make_array(const int val1, const int val2) noexcept { std::array<int, 2> result = { { val1, val2 } }; return result; } constexpr auto numbers_static = make_array(42, 0); } int main() { const auto numbers_automatic = make_array(42, 0); assert(numbers_automatic[0] == 42); // okay assert(numbers_static[0] == 42); // okay }