meson: Deprecate bitwise operations between different enumeration type

C++20 deprecates bitwise operations between different enumeration types.
This is a bad practice even in C++17, so enable the deprecation warning.
Doing so ensures no such operations will be added.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
This commit is contained in:
Laurent Pinchart 2024-05-03 02:44:11 +03:00
parent 4885f2d70d
commit bf4695266b

View file

@ -178,6 +178,15 @@ if cc.has_argument('-Wno-c99-designator')
] ]
endif endif
# Enable the C++20 deprecated enum-enum conversion warning if the compiler
# supports it. This helps avoiding C++20 regressions, and should be removed
# when switching to C++20 as the warning will then be enabled by default.
if cxx.has_argument('-Wdeprecated-enum-enum-conversion')
cpp_arguments += [
'-Wdeprecated-enum-enum-conversion',
]
endif
c_arguments += common_arguments c_arguments += common_arguments
cpp_arguments += common_arguments cpp_arguments += common_arguments