This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/59056] New: enable_if turns a non-ambiguous template into an ambiguous one
- From: "walter.mascarenhas at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 08 Nov 2013 22:19:17 +0000
- Subject: [Bug c++/59056] New: enable_if turns a non-ambiguous template into an ambiguous one
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59056
Bug ID: 59056
Summary: enable_if turns a non-ambiguous template into an
ambiguous one
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: walter.mascarenhas at gmail dot com
Created attachment 31187
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31187&action=edit
a simple code illustrating the bug
The attached file shows that by turning a specialization of
template <class A, class Enable = void>
struct Foo {};
like this one (which works just fine)
template <class A>
struct Foo<A, void>{};
into
template <class A>
struct Foo<A, std::enable_if< typename always_true<A>() >::type >{};
we can get ambigouities, even when typename always_true<A>() >::type
always resolves to void.
For more details, look at the attachement