Repository navigation
Refer to HPX by its fully qualified name in macros - #8175
Conversation
A missing line break made the definition of HPX_COROUTINE_DESTROY_CONTEXT part of HPX_COROUTINE_SWAP_CONTEXT in the Pth context (OS X before 10.5). Signed-off-by: Hartmut Kaiser <hartmut.kaiser@gmail.com>
Inside a namespace with a nested namespace hpx of its own (as for instance
thrust::system::hpx), the unqualified hpx:: of the macros found the nested
namespace instead. They now use ::hpx::, except in 'namespace hpx::... {'
and in the class heads of explicit specializations, which are at namespace
scope only. The new test macros_nested_hpx_namespace uses the macros inside
such a namespace.
Signed-off-by: Hartmut Kaiser <hartmut.kaiser@gmail.com>
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
HPX's macros referred to HPX as
hpx::.... Inside a namespace that has a nested namespacehpxof its own, that name finds the nested namespace instead. For instance,HPX_ASSERTinsidethrust::system::hpx(the HPX backend of Thrust, NVIDIA/cccl#7680) doesn't compile in Debug builds:no member named 'util' in namespace 'thrust::system::hpx'.The macros in the public headers now use
::hpx::(197 places in 26 headers): assertions, errors, futures, logging, tracing, serialization, type support, functional, plugins, runtime configuration, actions, components, channels, parcelset and the compression filters.namespace hpx::... {and the class heads of explicit specializations are left as they are: the first can't be qualified, and both are only used at namespace scope.The new test
macros_nested_hpx_namespace(in theincludemodule) uses the macros inside a namespace with a nestedhpxnamespace: at function scope (assertions, exceptions, exceptional futures, logging), at class scope (HPX_SERIALIZATION_SPLIT_MEMBER,HPX_DEFINE_COMPONENT_ACTION) and at namespace scope (HPX_DEFINE_PLAIN_ACTION). With the previous headers it fails to compile.While at it: in the Pth context (OS X before 10.5),
HPX_COROUTINE_DESTROY_CONTEXTwas part ofHPX_COROUTINE_SWAP_CONTEXTbecause of a missing line break. It is now defined separately.Tested with a Debug build with clang 23 (the libraries, the examples and the unit tests of the changed modules); the 89 unit tests of these modules pass.