[patch][pr17639] Consider alias as definitions

Alp Toker alp at nuanti.com
Tue Oct 22 14:02:22 PDT 2013


Nice work!

  void ActOnFinishKNRParamDeclarations(Scope *S, Declarator &D,
                                        SourceLocation LocAfterDecls);
-  void CheckForFunctionRedefinition(FunctionDecl *FD);
+  void CheckForFunctionRedefinition(FunctionDecl *FD,
+                                    const FunctionDecl *Definition = 0);
   Decl *ActOnStartOfFunctionDef(Scope *S, Declarator &D);
   Decl *ActOnStartOfFunctionDef(Scope *S, Decl *D);
   void ActOnStartOfObjCMethodDef(Scope *S, Decl *D);

You could name the optional parameter EffectiveDefinition to indicate
its purpose.

Otherwise looks good. r193188 was neat as well by the way.

Alp.

On 22/10/2013 21:23, Rafael EspĂ­ndola wrote:
> Hi Alp,
>
> Attached is a new version of the patch for pr17639. The differences on
> top of the patch you wrote are
>
> * Trying to fix just pr17639 for now to make the patch smaller.
> * Handle variables too.
> * Remove the warn_redefinition_alias, not clear why it is needed.
> * Simpler definition of isDefined. The decl with the alias attribute
> is the definition.
> * Uses the existing redefinition error when it makes sense.
>
> Cheers,
> Rafael

-- 
http://www.nuanti.com
the browser experts




More information about the cfe-commits mailing list