Skip to content
Snippets Groups Projects

EventContext: make constructor explicit

Merged Frank Winklmeier requested to merge fwinkl/Gaudi:explicit_ctx into master
All threads resolved!

We do not want to implicitly convert an integer to an EventContext as this would almost certainly result in an invalid event context.

We just had a case in ATLAS where something like the following code compiled fine and only at runtime we got an invalid EventContext error:

void foo(const EventContext& ctx);

int context; // variable incidentally named context that has nothing to do with an `EventContext`
foo(context);

Thanks to @bstanisl for pointing this out. cc @smh

Merge request reports

Pipeline #5451952 passed

Pipeline passed for a70146e9 on fwinkl:explicit_ctx

Merged by Marco ClemencicMarco Clemencic 1 year ago (May 5, 2023 12:04pm UTC)

Loading

Pipeline #5532676 passed

Pipeline passed for 91812cb6 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Marco Clemencic resolved all threads

    resolved all threads

  • mentioned in merge request lhcb/Online!827 (merged)

  • mentioned in merge request atlas/athena!62510 (merged)

  • Marco Clemencic mentioned in commit 91812cb6

    mentioned in commit 91812cb6

  • Please register or sign in to reply
    Loading