Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/AlternativeFinder.cc

    r4b0f997 rca946a4  
    766766                        } // if
    767767                } // for
    768                 // function may return struct or union value, in which case we need to add alternatives for implicit conversions to each of the anonymous members
     768
     769                candidates.clear();
     770                candidates.splice( candidates.end(), alternatives );
     771
     772                findMinCost( candidates.begin(), candidates.end(), std::back_inserter( alternatives ) );
     773
     774                // function may return struct or union value, in which case we need to add alternatives for implicit
     775                // conversions to each of the anonymous members, must happen after findMinCost since anon conversions
     776                // are never the cheapest expression
    769777                for ( const Alternative & alt : alternatives ) {
    770778                        addAnonConversions( alt );
    771779                }
    772 
    773                 candidates.clear();
    774                 candidates.splice( candidates.end(), alternatives );
    775 
    776                 findMinCost( candidates.begin(), candidates.end(), std::back_inserter( alternatives ) );
    777780
    778781                if ( alternatives.empty() && targetType && ! targetType->isVoid() ) {
Note: See TracChangeset for help on using the changeset viewer.