Disable clang warning for injected class name ambiguity in non_copyable_reference
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 6 Sep 2024 21:18:21 +0000 (21:18 +0000)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 9 Sep 2024 14:16:32 +0000 (10:16 -0400)
commit07bcbcf39e1a8dc2b4098a8480d0310cc67d78ac
treed3a4046bf96b4688c682220e0a6e83172266e66e
parentaedbbb5dcae0ede7c16bf0ff659ff762deba5226
Disable clang warning for injected class name ambiguity in non_copyable_reference

clang raises a warning (-Winjected-class-name) due to ambiguity between
a constructor name and a type within the non_copyable_reference code.

Since clang could not infer the correct type context, this commit uses
`#pragma clang diagnostic` to disable the specific warning in the
affected area of the code.

The `push` and `pop` pragmas ensure that the warning is disabled only
where needed, preventing it from affecting other parts of the codebase,
and allowing us to maintain clean and clear code without unnecessary
compiler warnings.

A static_assert enforces that CustomDeleter::deleter is indeed a type,
although interpreting it as a constructor would be non-sensical here.

Change-Id: Ic0aac06d7af4272438f6f3d0275f29dc57a32194
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/reference.hpp
This page took 0.025608 seconds and 4 git commands to generate.