From 62b368644dec14d1d916c778461f6d4d32e2182e Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sat, 29 Aug 2020 14:51:28 +0200 Subject: Updated test for enums based on recently fixed issues --- testing/073/073__typed__enum_8cpp.xml | 96 +++++++++++++++++++++++++++++++++++ testing/073_typed_enum.cpp | 18 +++++++ 2 files changed, 114 insertions(+) diff --git a/testing/073/073__typed__enum_8cpp.xml b/testing/073/073__typed__enum_8cpp.xml index 7e68f3e..9d6947e 100644 --- a/testing/073/073__typed__enum_8cpp.xml +++ b/testing/073/073__typed__enum_8cpp.xml @@ -15,6 +15,102 @@ + + unsigned char + Mem + + Bottom + = 0 + + + + + + + NotMem + = 1U << 0 + + + + + + + Ptr + = 1U << 1 + + + + + + + Lval + = 1U << 2 + + + + + + + Mem + = Ptr | Lval + + + + + + + Top + = NotMem | Mem + + + + + + + Strongly types enum when values that has the same name as the enum. + + + + + + + + + + @0 + + Unnamed1 + + + + + + + + + + + + + + + + @1 + + Unnamed2 + + + + + + + + + + + + + diff --git a/testing/073_typed_enum.cpp b/testing/073_typed_enum.cpp index 0818463..7248c96 100644 --- a/testing/073_typed_enum.cpp +++ b/testing/073_typed_enum.cpp @@ -5,3 +5,21 @@ /** @brief A strongly-typed enum */ enum class E: unsigned short {}; + +/** @brief Strongly types enum when values that has the same name as the enum */ +enum class Mem : unsigned char { + Bottom = 0, + NotMem = 1U << 0, + Ptr = 1U << 1, + Lval = 1U << 2, + Mem = Ptr | Lval, + Top = NotMem | Mem, +}; + +enum { + Unnamed1 +}; + +enum { + Unnamed2 +}; -- cgit v0.12