Skip to content
Snippets Groups Projects
Commit 478e9c15 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

AthenaKernel: Prevent implicit StatusCode conversion in CHECK

Prevent the following code from compiling as that relies on an
implicit conversion of the return value of `myFunc` into a `StatusCode`:
```
int myFunc();

CHECK(myFunc());
```
parent 0477337e
Branches mon_stringview
No related tags found
No related merge requests found
Pipeline #1738663 failed
// This file's extension implies that it's C, but it's really -*- C++ -*-.
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
/**
......@@ -396,13 +396,13 @@ private:
BOOST_PP_OVERLOAD(CHECK_WITH_CONTEXT_, __VA_ARGS__)(__VA_ARGS__)
#define CHECK_WITH_CONTEXT_2(EXP, CONTEXT_NAME) do { \
StatusCode sc__(EXP); \
StatusCode sc__ = (EXP); \
if (! sc__.isSuccess()) \
CHECK_FAILED(EXP, CONTEXT_NAME, sc__, sc__); \
} while (0)
#define CHECK_WITH_CONTEXT_3(EXP, CONTEXT_NAME, RET) do { \
StatusCode sc__(EXP); \
StatusCode sc__ = (EXP); \
if (! sc__.isSuccess()) \
CHECK_FAILED(EXP, CONTEXT_NAME, sc__, RET); \
} while (0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment