[LLVMbugs] [Bug 8436] New: -Wshadow on nested static data members

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Oct 22 07:49:10 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=8436

           Summary: -Wshadow on nested static data members
           Product: new-bugs
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: Axel.Naumann at cern.ch
                CC: llvmbugs at cs.uiuc.edu


struct A {
   static void* f; void* g;
   struct B { static void* f; void* g; };
};

compiled with
clang++ -c -Wall -Wshadow -O2 t.cxx
generates the warning

t.cxx:3:28: warning: declaration shadows a static data member of 'A'
[-Wshadow]
   struct B { static void* f; void* g; };
                           ^
t.cxx:2:17: note: previous declaration is here
   static void* f; void* g;

Comment from Doug:
> It doesn't seem at all useful for Clang to warn about static data members 
> shadowing something else by the same name. Personally, I'd limit -Wshadow to
> only complain when a local declaration shadows something from the outer scope.

Could this get fixed, please?

Cheers, Axel.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list