C++ PATCH: PR 21514

Gabriel Dos Reis gdr@integrable-solutions.net
Thu Oct 6 21:16:00 GMT 2005


Gabriel Dos Reis <gdr@integrable-solutions.net> writes:

| Mark Mitchell <mark@codesourcery.com> writes:
| 
| | This patch fixes PR 21514, which is also the subject of DR 488. 
| | 
| | The key question is whether or not SFINAE applies to trying to use a
| | template function in such a way that an anonymous type would have to
| | be bound to a template parameter.  A strict reading of the standard
| | grants no exemption for that case, so before GCC 4.0 I made this an
| | error.
| | 
| | However, the expected resolution of DR 488 means that SFINAE will
| | apply.  Since the issue is in draft state, we wouldn't normally adjust
| | the compiler, but, as others have argued, (a) the change can only
| | accept invalid programs, not reject valid ones, and (b) the outcome in
| | the committee seems all but certain, and (c) searching the internet
| | shows that this issue is frustruating a lot of people upgrade to GCC
| | 4.0.x.  So, I've made the change.
| 
| Thanks.  I would like to add that this issue is under active
| discussion on the CWG reflector and I doubt the resolution as
| currently proposed would pass committee vote. 
| 
| We may most probably have to revert this change that linkage causes
| deduction failure, but if it can cure the issue to some extent,
| pending committee decision, I'm OK.  I'd watch out that nobody
| constructs the argument that GCC implements this behaviour :-)

I'm delighted to report that EWG and CWG have reconsidered this issue
again, and it is now the consensus that linkage should not crep in in the
first place, and unnamed enums at namespace scope should be handled
just "like" unnamed namespaces, therefore not SNIFAE and not an
error.  It just works.

The issue of local types as template arguments is not fully resolved yet.

-- Gaby



More information about the Gcc-patches mailing list