[PATCH] D78134: [Sema] Don't apply an lvalue-to-rvalue conversion to a discarded-value expression if it has an array type
    Richard Smith - zygoloid via Phabricator via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Tue Apr 14 14:05:15 PDT 2020
    
    
  
rsmith added a comment.
It seems to me that there's as bug in the C++ specification here. The rules for discarded-value expressions say the lvalue-to-rvalue conversion is applied, whereas the rules for lvalue-to-rvalue conversions say one cannot be applied in this case. It's hard to guess what the correct behavior is (do we copy from the array or not?). But the rules do explicitly say "The array-to-pointer (7.3.2) and function-to-pointer (7.3.3) standard conversions are not applied." and it's unclear what effect that would have other than to cause a volatile copy of the entire array in a case such as this. I'm going to take this to CWG.
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78134/new/
https://reviews.llvm.org/D78134
    
    
More information about the cfe-commits
mailing list