[Lldb-commits] [PATCH] D131472: [LLDB] Add multi value test for const static enum

Shafik Yaghmour via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 9 16:09:54 PDT 2022


shafik added a comment.

In D131472#3709684 <https://reviews.llvm.org/D131472#3709684>, @labath wrote:

> Good catch. Lldb should try to be useful even if the debugged program invokes undefined behavior.

Totally agree, for the purposes here there should be no difference for these purposes between a scoped enum and an enum without a fixed underlying type.



================
Comment at: lldb/test/API/lang/cpp/const_static_integral_member/main.cpp:52
   const static ScopedEnum invalid_scoped_enum_val = static_cast<ScopedEnum>(5);
+  const static ScopedEnum invalid_scoped_enum_val_2 =
+      static_cast<ScopedEnum>(7);
----------------
I am just going to super nitpick here and say that these are not invalid values. When we have a fixed underlying type we are allowed to use the full range of the underlying type. The values may be outside the range of the enumerators but they are valid values. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131472/new/

https://reviews.llvm.org/D131472



More information about the lldb-commits mailing list