Fix warnings when `-Wdeprecated-enum-enum-conversion` is enabled
clang may throw the following warning: include/clang/AST/DeclarationName.h:210:52: error: arithmetic between different enumeration types ('clang::DeclarationName::StoredNameKind' and 'clang::detail::DeclarationNameExtra::ExtraKind') is deprecated when flags -Werror,-Wdeprecated-enum-enum-conversion are on. This adds the `addEnumValues()` helper function to STLExtras.h to hide the details of adding enumeration values together from two different enumerations.
Showing
- clang/include/clang/AST/DeclarationName.h 20 additions, 9 deletionsclang/include/clang/AST/DeclarationName.h
- llvm/include/llvm/ADT/STLExtras.h 11 additions, 0 deletionsllvm/include/llvm/ADT/STLExtras.h
- llvm/unittests/ADT/STLExtrasTest.cpp 29 additions, 0 deletionsllvm/unittests/ADT/STLExtrasTest.cpp
Loading
Please register or sign in to comment