rmarker wrote:

> > > @mydeveloperday @HazardyKnusperkeks @rymiel this patch fixes a very old 
> > > bug and will cause behavior changes whether the default is changed to the 
> > > new `AllowShortType` or left at `None`. Which way should we go?
> > 
> > 
> > Now I'm leaning toward keeping the existing (buggy) behavior of `None` and 
> > using the new `AllowShortType` to allow wrapping after short return types.
> 
> Buggy would be no break? That would be what I expect from `None`. :) So +1 
> from me.

`None` prevents breaks after short return types. The buggy behaviour is that it 
doesn't take leading indentation into account when determining if a return type 
is short or not. This means that if there is indentation, it wouldn't think a 
type is short that otherwise would be, and would thus allow a break after the 
return type.
Fixing the bug would cause return types in more situations to be identified as 
short and thus prevent breaks previously allowed (changing the previous 
behaviour).

 ```
 // Buggy None
void LongName::
      AnotherLongName();
class C {
   void
   LongName::AnotherLongName();
};

// Fixed None
void LongName::
      AnotherLongName();
class C {
   void LongName::
        AnotherLongName();
};
 ```

https://github.com/llvm/llvm-project/pull/78011
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to