[all-commits] [llvm/llvm-project] 7c3d8c: Fix warnings when `-Wdeprecated-enum-enum-conversi...

Antonio Frighetto via All-commits all-commits at lists.llvm.org
Thu Apr 7 05:23:27 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7c3d8c8977cfc013254783b85b9fc6026566b35f
      https://github.com/llvm/llvm-project/commit/7c3d8c8977cfc013254783b85b9fc6026566b35f
  Author: Antonio Frighetto <me at antoniofrighetto.com>
  Date:   2022-04-07 (Thu, 07 Apr 2022)

  Changed paths:
    M clang/include/clang/AST/DeclarationName.h
    M llvm/include/llvm/ADT/STLExtras.h
    M llvm/unittests/ADT/STLExtrasTest.cpp

  Log Message:
  -----------
  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.




More information about the All-commits mailing list