https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69009

--- Comment #5 from W E Brown <webrown.cpp at gmail dot com> ---
I have encountered this issue several more times since my original report, and
am writing to report a pattern I recently noticed among cases that ICE vs
similar cases that compile correctly.  (I'm now using MacPorts gcc6
6-20160110_0.)

The following two representative code samples are similar in structure. 
However, the first (is_floating_point_v<>) does compile for me, while the
second (is_pointer_v<>) gives the reported ICE "in instantiate_decl, at
cp/pt.c:21511":

  template< typename T >
  constexpr bool
    is_unqual_floating_point_v = false;
  //
  template< >
  constexpr bool
    is_unqual_floating_point_v<float> = true;
  //
  template< >
  constexpr bool
    is_unqual_floating_point_v<double> = true;
  //
  template< >
  constexpr bool
    is_unqual_floating_point_v<_ldbl> = true;

  template< typename T >
  constexpr bool
    is_floating_point_v = is_unqual_floating_point_v< ::_tt::remove_cv_t<T> >;

  // ----------

  template< typename T >
  constexpr bool
    is_unqual_pointer_v = false;
  //
  template< typename U >
  constexpr bool
    is_unqual_pointer_v<U*> = true;

  template< typename T >
  constexpr bool
    is_pointer_v = is_unqual_pointer_v< ::_tt::remove_cv_t<T> >;
                   ^

Note that in one case, the is_unqual*<> helper employs complete specialization,
while the helper in the other case uses partial specialization.

I have found this observation to be a reliable discriminator between cases that
compile for me and those that ICE as reported; I hope it may be useful in
analyzing and resolving the issue.

Reply via email to