https://github.com/ojhunt commented:

In general this looks fine but I'd like @shafik's feedback as well.

My only real question is the reason for not using scoped enums? This is a 
genuine question outside of just this PR, as enum classes trade off a bunch of 
convenience in exchange for there tighter type constraints.

I'd certainly prefer enum class as it makes the enumerations read better and 
avoids accidental bool usage, but I get that it's trade that off against a lot 
of verbosity and the lack of some basic `if(scopedenumeration)`, etc syntax.

I don't consider this a "must change" consideration, but for instance:

```cpp
enum class MemberInitKind {Default, NonDefault}
```

gives you `MemberInitKind::Default` vs `DefaultMemberInit` which isn't hugely 
shorter, and seems subjectively better to me, however I recognize it means that 
in other cases this same pattern causes a lot of verbosity in things like 
`allowsNRVO()` where you end up with `LocAndNRVO.NRVOMode == NRVOKind::Allowed` 
under the same scheme.

So again I don't consider this a blocker to the PR, I just want to know if 
scoped enums were considered and dismissed (partially because I want to do 
something about some of the annoyances of scoped enums).

https://github.com/llvm/llvm-project/pull/185335
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to