rjmccall added a comment. C++ says:
[expr.context]p2: > In some contexts, an expression only appears for its side effects. Such an > expression is called a discarded-value expression. The array-to-pointer > (7.3.2) and function-to-pointer (7.3.3) standard conversions are not applied. > The lvalue-to-rvalue conversion (7.3.1) is applied if and only if the > expression is a glvalue of volatile-qualified type and it is one of the > following: > > - (list of special forms) [conv.lval]p1: > A glvalue of a non-function, non-array type T can be converted to a prvalue. So I think the right fix is probably to make sure that `Sema::DefaultLvalueConversion` ignores gl-values of array type. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78134/new/ https://reviews.llvm.org/D78134 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits