explicit specialization in non-namespace scope

Mark Mitchell mark@markmitchell.com
Mon Sep 28 16:32:00 GMT 1998

>>>>> "Nathan" == Nathan Myers <ncm@cygnus.com> writes:

    Nathan> Mark Mitchell wrote:
    >>  >>>>> "Nathan" == Nathan Myers <ncm@cygnus.com> writes:
    Nathan> It's still not clear that the above text applies to the
    Nathan> case mentioned.  "In the namespace of which the enclosing
    Nathan> class is a member" is satisified both outside and inside
    Nathan> the class.  When it means to say "not in a class or in a
    Nathan> block", it says "at namespace scope" or sometimes "in
    Nathan> namespace scope"; these are changed from "at global scope"
    Nathan> which is what it said before we had namespaces.  "In the
    Nathan> namespace of" does not imply "only at namespace scope".

    >>  I can see the sense in your interpretation.  (After all,
    >> besides implementing the removal of this feature, I also
    >> implemented the feature in the first place...)

I still haven't reimplemented this feature.  We've hashed out most of
the details, but I now remember one of the reasons I removed the
feature: it's not allowed by the grammar provided in the appendix to
the standard.  In particular, we have:

          decl-specifier-seqopt member-declarator-listopt ;
          function-definition ;opt
          ::opt nested-name-specifier templateopt unqualified-id ;

The only choices which could reasonably allow an explicit
specialization are `function-definition' and `template-declaration'.
The former, however, does not allow a template paramter list (and this
would be odd, since it would prohibit declaring a specialization
in-class, but defining it out-of-class).  The grammar for a
`template-declaration' specifically disallows an explicit
specialization, which is listed separately as

What do you make of this?

Mark Mitchell 			mark@markmitchell.com
Mark Mitchell Consulting	http://www.markmitchell.com

More information about the Gcc mailing list