ConcurrentHashTable::NoOp omits return in non-void return method

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 16
    • Affects Version/s: 11, 15, 16
    • Component/s: hotspot
    • None
    • b22

      Static analysis complains there is a non-void return method without a return statement:

        struct NoOp {
          void operator()(VALUE*) {}
          const VALUE& operator()() {} // <--- here
          void operator()(bool, VALUE*) {}
        } noOp;

      AFAICS, this is UB, and we have seen cases like these break compilers in other places. Not in this case, though, because noOp is only used as the default functor in remove. Still, it would be good to remove that risky definition, so that it is not used accidentally.

            Assignee:
            Aleksey Shipilev
            Reporter:
            Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: