[cfe-commits] Patch for PR5273

Sebastian Redl sebastian.redl at getdesigned.at
Thu Oct 29 13:34:23 PDT 2009


Brandon Pearcy wrote:
> Hello again John!
>
>     This catches the case where we're taking the address of the
>     argument, but not the case where we're passing it by reference
>     argument to some function.
>
>
> I am sure I am overlooking something, but I thought I'd push back for 
> now. Do we care if it is passed by reference to a function? The only 
> valid operations within that function (that I can imagine) would be to 
> take the address of the uninitialized field, or assign a value to it. 
> The former can be achieved by passing the address into the function,

Even assuming that the programmer has control over the constructor he 
passes his object to (it could be a 3rd party library), do you think 
it's right for Clang to warn about what comes down to coding style? When 
I write code like this, I always pass by reference.

Sebastian



More information about the cfe-commits mailing list