Ticket #11871: missing-return.patch

File missing-return.patch, 1.3 KB (added by ingo.loehken@…, 7 years ago)

patch

  • boost/property_tree/detail/json_parser/standard_callbacks.hpp

    # HG changeset patch
    # User iloehken
    # Date 1450895187 -3600
    #      Wed Dec 23 19:26:27 2015 +0100
    # Branch 1.60
    # Node ID b5590705aeb464fc9c6d9ff20a3c7ccbfc8c8aff
    # Parent  973baab4f688d8878afb9615465c16389859f75d
    fixed missing return statements
    
    diff -r 973baab4f688 -r b5590705aeb4 boost/property_tree/detail/json_parser/standard_callbacks.hpp
    a b  
    117117            }
    118118            case object:
    119119                assert(false); // must start with string, i.e. call new_value
     120                // axx: ilo 23/12/2015: let crash
     121                return reinterpret_cast<Ptree&>(*static_cast<Ptree*>(nullptr));
    120122            case key: {
    121123                l.t->push_back(std::make_pair(key_buffer, Ptree()));
    122124                l.k = object;
     
    129131                return new_tree();
    130132            }
    131133            assert(false);
     134            // axx: ilo 23/12/2015: just to satisfy the compiler having a return statement
     135            return reinterpret_cast<Ptree&>(*static_cast<Ptree*>(nullptr));
    132136        }
    133137        string& new_value() {
    134138            if (stack.empty()) return new_tree().data();