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: unassignedclangb...@nondot.org
          Reporter: oleg.mishc...@itiviti.com
                CC: blitzrak...@gmail.com, dgre...@apple.com,
                    erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
                    richard-l...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to