[llvm-bugs] [Bug 48367] New: Wrong warning: declaration shadows a static data member of ... ; for forward declared enums -Wshadow

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Dec 3 01:15:03 PST 2020


https://bugs.llvm.org/show_bug.cgi?id=48367

            Bug ID: 48367
           Summary: Wrong warning: declaration shadows a static data
                    member of ... ; for forward declared enums -Wshadow
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: Oleg.Mishchuk at itiviti.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

https://godbolt.org/z/8Kr37W

Reproduces from clang 8.0.0

// ------------------------------------

struct A
{
    enum AA : int;
    enum AAA : int
    {
        x, y
    };
};

struct B
{
    enum BB : int;
    enum BBB : int
    {
        y, z // OK
    };
};

enum A::AA : int
{
    a, b
};

enum B::BB : int
{
    b, c // warning: declaration shadows a static data member of 'A' [-Wshadow]
};

// ------------------------------------

<source>:26:5: warning: declaration shadows a static data member of 'A'
[-Wshadow]
    b, c // warning: declaration shadows a static data member of 'A' [-Wshadow]
    ^
<source>:21:8: note: previous declaration is here
    a, b
       ^
1 warning generated.
Compiler returned: 0

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201203/0928c7a8/attachment.html>


More information about the llvm-bugs mailing list