This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/56838] GCC svn doesn't compile libreoffice 4.0.1.2
- From: "jason at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 05 Apr 2013 14:37:52 +0000
- Subject: [Bug c++/56838] GCC svn doesn't compile libreoffice 4.0.1.2
- Auto-submitted: auto-generated
- References: <bug-56838-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56838
--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> 2013-04-05 14:37:52 UTC ---
(In reply to comment #2)
> The candidate in /usr/include/boost/bind/bind.hpp:1478 a.cpp:92092 fails.
> SFINAE so this candidate is skipped.
Actually, it doesn't fail SFINAE. If the the candidate at a.cpp:92176 is
removed, 4.7.2 and 4.8.0 will choose the one at a.cpp:92092 and then get the
same error message. In those compilers, both are valid candidates, but the
later one is preferred by the partial ordering rules, and so we don't
instantiate the earlier one and we don't get the error.
But then I changed G++ to enforce the rule that forming a function type with an
abstract return type causes deduction to fail. In order to check that, we need
to instantiate the return type so that we can tell whether or not it is
abstract. This happens while generating the candidate, and that's what causes
the error.
It seems to me that instead of having all those overloads of bind() for
different numbers of function parameters, boost ought to have partial
specializations of result_traits, i.e.
template <class R, class B1, class B2>
struct result_traits<unspecified, R (*)(B1, B2)>
{
typedef R type;
};
which would make the first overload well-formed.