[cfe-commits] [PATCH][MS][Review request] - Microsoft function specialization at scope scope

John McCall rjmccall at apple.com
Thu Jun 16 18:52:52 PDT 2011

On Jun 16, 2011, at 6:26 PM, Francois Pichet wrote:

> I struggled getting this patch right and I am not confident enough to
> submit it directly without review so here it is:
> Template function specialization at class scope for -fms-extensions
> Example:
> template <class T>
> class B {
> public:
>   template <class U>
>   void f(U p) {   }
>   template <>
>    void f(int p) {	}  // <= not standard C++, Microsoft extension
> };
> As Doug suggested to me on the IRC chat, I created a new Decl node:
> ClassScopeFunctionSpecializationDecl
> This node hold a temporary CXXMethodDecl and it will use it to create
> an explicit specialization during class instantiation.

Can you explain the need to do this rather than simply making this
a FunctionTemplateSpecializationDecl, like it would be at global
scope?  There's already code in SemaTemplateInstantiateDecl for
instantiating such things;  I'm sure it would need to be changed,


More information about the cfe-commits mailing list