AaronBallman wrote:

> > The enum we had in the past described the syntax of the new expression.
> 
> Even if it was the case at some point, I'm not sure it held when I created 
> the PR, which eliminated this kind of nasty mapping, encoding how this enum 
> was actually used:
> 
> ```c++
>  CXXNewExprBits.StoredInitializationStyle =
>       Initializer ? InitializationStyle + 1 : 0;
> ```
> 
> ```c++
>   InitializationStyle getInitializationStyle() const {
>     if (CXXNewExprBits.StoredInitializationStyle == 0)
>       return NoInit;
>     return static_cast<InitializationStyle>(
>         CXXNewExprBits.StoredInitializationStyle - 1);
> ```

Yeah, perhaps calling this NFC was a stretch because it does have a minor 
functional change in what it expresses; sorry for that confusion! I think the 
current form is a more clean way to express the code. Are you finding it's 
causing issues beyond just the change to test behavior?

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

Reply via email to