Skip to content
Snippets Groups Projects

TrigHLTJetHypo: Fix clang warnings.

Merged Scott Snyder requested to merge ssnyder/athena:clang.TrigHLTJetHypo-20190712 into master
1 unresolved thread

clang warnings:

  • Don't use std::move on rvalues.
  • Classes with virtual methods should usually have a virtual dtor.
  • Unused private data members.
    • used instead of << in output streaming.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
22 22
23 23 m_conditions = m_config->getConditions();
24 24
25 m_grouper = std::move(m_config->getJetGrouper());
  • Hmm. @ssnyder I have to say I'm a bit confused by your change here.

    m_config returns a unique_ptr->getJetGrouper() and so isn't std::move correct?

  • Author Developer

    hi -

    No. Rule of thumb is that you should only use std::move on an lvalue (i.e., something with a name), and not in a return statement. Don't use it on a temporary value as you have here.

    One way to think of std::move is as a lvalue->rvalue conversion, so it doesn't make sense to apply it to something that's already an rvalue, and doing so will inhibit optimizations in some contexts. clang gives warnings about such uses.

  • Please register or sign in to reply
  • Please register or sign in to reply
    Loading