zygoloid wrote:

There are 
[techniques](https://github.com/carbon-language/carbon-lang/blob/69ab97d7167146ae1deea662126af66f8f5523a2/common/struct_reflection.h#L74)
 for determining the number of fields in an aggregate type `T` by attempting to 
initialize with `T{}` then `T{arg}` then `T{arg, arg}`, and so on (with an 
`arg` that converts to anything), until the initialization fails. Such 
techniques might in principle show up in a system header (eg, boost probably 
has this somewhere).

However, any such code should be in an unevaluated operand, so as long as this 
warning is suppressed in unevaluated operands I think it's fine for it to be 
enabled in system headers. (For extra assurance, can we make this a 
`DiagRuntimeBehavior` to also suppress it in unreachable code?)

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

Reply via email to