Skip to content
Snippets Groups Projects
  • Richard Smith's avatar
    c15b46ec
    Switch to a different workaround for unimplementability of P0145R3 in MS ABIs. · c15b46ec
    Richard Smith authored
    Instead of ignoring the evaluation order rule, ignore the "destroy parameters
    in reverse construction order" rule for the small number of problematic cases.
    This only causes incorrect behavior in the rare case where both parameters to
    an overloaded operator <<, >>, ->*, &&, ||, or comma are of class type with
    non-trivial destructor, and the program is depending on those parameters being
    destroyed in reverse construction order.
    
    We could do a little better here by reversing the order of parameter
    destruction for those functions (and reversing the argument evaluation order
    for all direct calls, not just those with operator syntax), but that is not a
    complete solution to the problem, as the same situation can be reached by an
    indirect function call.
    
    Approach reviewed off-line by rnk.
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@282777 91177308-0d34-0410-b5e6-96231b3b80d8
    c15b46ec
    History
    Switch to a different workaround for unimplementability of P0145R3 in MS ABIs.
    Richard Smith authored
    Instead of ignoring the evaluation order rule, ignore the "destroy parameters
    in reverse construction order" rule for the small number of problematic cases.
    This only causes incorrect behavior in the rare case where both parameters to
    an overloaded operator <<, >>, ->*, &&, ||, or comma are of class type with
    non-trivial destructor, and the program is depending on those parameters being
    destroyed in reverse construction order.
    
    We could do a little better here by reversing the order of parameter
    destruction for those functions (and reversing the argument evaluation order
    for all direct calls, not just those with operator syntax), but that is not a
    complete solution to the problem, as the same situation can be reached by an
    indirect function call.
    
    Approach reviewed off-line by rnk.
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@282777 91177308-0d34-0410-b5e6-96231b3b80d8
Code owners
Assign users and groups as approvers for specific file changes. Learn more.