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

Francois Pichet pichet2000 at gmail.com
Mon Aug 1 10:24:51 PDT 2011


On Mon, Aug 1, 2011 at 1:06 PM, Francois Pichet <pichet2000 at gmail.com> wrote:
> ok thanks for the review. I am slowly working on the rework (but I am
> slow since this is summer time) 2 things I want to comment:
>
>
>> +  // Here we have an function template explicit specialization at class scope.
>> +  // The actually specialization will be postponed to template instatiation
>> +  // time via the ClassScopeFunctionSpecializationDecl node.
>> +  if (isDependantClassScopeExplicitSpecialization) {
>> +    ClassScopeFunctionSpecializationDecl *NewSpec =
>> +                         ClassScopeFunctionSpecializationDecl::Create(
>> +                                Context, CurContext,  SourceLocation(),
>> +                                cast<CXXMethodDecl>(NewFD));
>> +    CurContext->addDecl(NewSpec);
>> +    // FIXME: This is hackish: set NewFD to invalid and Redeclaration to true,
>> +    // to prevent NewFD from been pushed into scope.
>> +    NewFD->setInvalidDecl();
>> +    Redeclaration = true;
>> +  }
>>
>> Why not return return NewSpec, and have the caller recognize that it shouldn't try to make ClassScopeFunctionSpecializationDecls visible? (Since they aren't NamedDecls anyway).
>>
>
> How can we return NewSpec here? This won't work, We need to return a
> FunctionDecl otherwise the function body will be correctly parsed.

 the function body will *not* be correctly parsed.




More information about the cfe-commits mailing list