[Bug c++/80387] [6/7 Regression] G++ get stuck due to decltype over constexpr static function in using declaration

2017-04-11 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80387

Markus Trippelsdorf  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INVALID

--- Comment #7 from Markus Trippelsdorf  ---
(In reply to Jonathan Wakely from comment #6)
> This code isn't strictly ice-on-invalid, it's just completely crazy and no
> compiler will ever handle it, because it asks for std::index_sequence<0, 1,
> 2, 3, ..., 18446744073709551614>.
> 
> We could add a static_assert( N != size_t(-1), "" ) but that wouldn't help
> for equally crazy cases like make_index_sequence. Maybe we
> should just reject anything over ULONG_MAX/2.

Lets just call it a pilot error and close it as invalid.

[Bug c++/80387] [6/7 Regression] G++ get stuck due to decltype over constexpr static function in using declaration

2017-04-11 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80387

--- Comment #6 from Jonathan Wakely  ---
This code isn't strictly ice-on-invalid, it's just completely crazy and no
compiler will ever handle it, because it asks for std::index_sequence<0, 1, 2,
3, ..., 18446744073709551614>.

We could add a static_assert( N != size_t(-1), "" ) but that wouldn't help for
equally crazy cases like make_index_sequence. Maybe we should just
reject anything over ULONG_MAX/2.

[Bug c++/80387] [6/7 Regression] G++ get stuck due to decltype over constexpr static function in using declaration

2017-04-11 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80387

--- Comment #5 from Jonathan Wakely  ---
PR 80396 requests such a builtin.

[Bug c++/80387] [6/7 Regression] G++ get stuck due to decltype over constexpr static function in using declaration

2017-04-11 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80387

--- Comment #4 from Jonathan Wakely  ---
Reverting that change is not an option. I might be able to add some sanity
checking to reject invalid cases.

What we really want is a builtin to generate the pack expansion.

[Bug c++/80387] [6/7 Regression] G++ get stuck due to decltype over constexpr static function in using declaration

2017-04-11 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80387

Martin Liška  changed:

   What|Removed |Added

   Keywords||ice-on-invalid-code
 CC||marxin at gcc dot gnu.org,
   ||redi at gcc dot gnu.org

--- Comment #3 from Martin Liška  ---
Confirmed, started with r230496:

PR libstdc++/66059 optimise _Build_index_tuple

PR libstdc++/66059
* include/std/utility (_Build_index_tuple): Optimise.

where revision before that:

In file included from pr80387.cpp:1:0:
/home/marxin/DATA/gcc-binaries/gcc-77511595a0954c5a2e69dc584c65aa69612e2614/include/c++/6.0.0/utility:
In instantiation of ‘struct std::_Build_index_tuple<18446744073709551517ul>’:
/home/marxin/DATA/gcc-binaries/gcc-77511595a0954c5a2e69dc584c65aa69612e2614/include/c++/6.0.0/utility:225:69:
  recursively required from ‘struct
std::_Build_index_tuple<18446744073709551614ul>’
/home/marxin/DATA/gcc-binaries/gcc-77511595a0954c5a2e69dc584c65aa69612e2614/include/c++/6.0.0/utility:225:69:
  required from ‘struct std::_Build_index_tuple<18446744073709551615ul>’
pr80387.cpp:16:53:   required from ‘struct type_list<>’
pr80387.cpp:21:28:   required from here
/home/marxin/DATA/gcc-binaries/gcc-77511595a0954c5a2e69dc584c65aa69612e2614/include/c++/6.0.0/utility:225:69:
fatal error: template instantiation depth exceeds maximum of 100 (use
-ftemplate-depth= to increase the maximum)
   typedef typename _Build_index_tuple<_Num - 1>::__type::__next __type;
 ^~

Looks clang also hangs in an infinite loop.

[Bug c++/80387] [6/7 Regression] G++ get stuck due to decltype over constexpr static function in using declaration

2017-04-11 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80387

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug c++/80387] [6/7 Regression] G++ get stuck due to decltype over constexpr static function in using declaration

2017-04-10 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80387

Thomas Koenig  changed:

   What|Removed |Added

   Target Milestone|--- |7.0

[Bug c++/80387] [6/7 Regression] G++ get stuck due to decltype over constexpr static function in using declaration

2017-04-10 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80387

Markus Trippelsdorf  changed:

   What|Removed |Added

   Keywords||compile-time-hog,
   ||memory-hog
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-04-11
 CC||trippels at gcc dot gnu.org
Summary|G++ get stuck due to|[6/7 Regression] G++ get
   |decltype over constexpr |stuck due to decltype over
   |static function in using|constexpr static function
   |declaration |in using declaration
 Ever confirmed|0   |1