This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/72076] cmath: illegal instruction (constexpr)
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 09 Aug 2016 21:33:21 +0000
- Subject: [Bug middle-end/72076] cmath: illegal instruction (constexpr)
- Auto-submitted: auto-generated
- References: <bug-72076-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72076
--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Thorsten Hirsch from comment #6)
> One by one. :)
> I mean this snippet:
>
> template<typename _Tp>
>
> constexpr
>
> typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
>
> int>::__type
>
> ilogb(_Tp __x)
>
> { return __builtin_ilogb(__x); }
>
>
> Is this valid? Or should there be an "int" or "float" after the "constexpr"
> in line 2?
typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
int>::__type
is a type, it is either SFINAE or is int. Basically the template is rejected
as a substitution failure and not considered or is the type is an int.
This is standard C++98ism. One which is confusing but used so you can do
overloads which are not considered part of the overload class.
See https://en.wikipedia.org/wiki/Substitution_failure_is_not_an_error for more
information on that.
Again do you have a preprocessed source for the failure you are seeing and what
is the full error message?