[all-commits] [llvm/llvm-project] f2daa3: [clangd] Remove potential prefix from enum value n...

Christian Kandeler via All-commits all-commits at lists.llvm.org
Thu May 2 04:19:20 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f2daa32fcaa061daa04546c343198d876e635def
      https://github.com/llvm/llvm-project/commit/f2daa32fcaa061daa04546c343198d876e635def
  Author: Christian Kandeler <christian.kandeler at qt.io>
  Date:   2024-05-02 (Thu, 02 May 2024)

  Changed paths:
    M clang-tools-extra/clangd/refactor/tweaks/ScopifyEnum.cpp
    M clang-tools-extra/clangd/unittests/tweaks/ScopifyEnumTests.cpp
    M clang-tools-extra/docs/ReleaseNotes.rst

  Log Message:
  -----------
  [clangd] Remove potential prefix from enum value names (#83412)

... when converting unscoped to scoped enums.
With traditional enums, a popular technique to guard against potential
name clashes is to use the enum name as a pseudo-namespace, like this:
  enum MyEnum { MyEnumValue1, MyEnumValue2 };
With scoped enums, this makes no sense, making it extremely unlikely
that the user wants to keep such a prefix when modernizing. Therefore,
our tweak now removes it.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list