On Thu, Aug 20, 2026 at 09:44:03PM -0400, Patrick Palka wrote:
> The inline definition of std::initializer_list in this testcase is not
> what the compiler expects on i686 due to over-reduction of the original
> testcase.  Better to just include <initializer_list> instead.
> 
> gcc/testsuite/ChangeLog:
> 
>       * g++.dg/cpp0x/initlist135.C: Include <initializer_list> and
>       remove the inline definition of std::initializer_list.

Just using decltype (sizeof (int)) instead of unsigned long would do it too
I think (no need to change what you've committed of course).

> --- a/gcc/testsuite/g++.dg/cpp0x/initlist135.C
> +++ b/gcc/testsuite/g++.dg/cpp0x/initlist135.C
> @@ -1,14 +1,9 @@
>  // PR c++/126472
>  // { dg-do run { target c++11 } }
>  
> +#include <initializer_list>
> +
>  namespace std {
> -template <class _E> struct initializer_list {
> -  typedef const _E *const_iterator;
> -  const _E *_M_array;
> -  unsigned long _M_len;
> -  const_iterator begin() const { return _M_array; }
> -  const_iterator end() const { return begin() + _M_len; }
> -};
>  struct _Optional_payload_base {
>    struct _Storage {
>      constexpr _Storage() : _M_empty() {}
> -- 
> 2.55.0.618.g1a3e64c6c4

        Jakub

Reply via email to