[LLVMbugs] [Bug 19949] New: -Wshadow warns about shadowing inaccessible nested member variables

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jun 5 02:13:26 PDT 2014


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

            Bug ID: 19949
           Summary: -Wshadow warns about shadowing inaccessible nested
                    member variables
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jthackray at riverbed.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

This is very similar to bug 6808. -Wshadow complains that an
inaccessible nested member variable is being shadowed, even
when it cannot be accessed:

$ cat test.cpp
class A {
   class B {
      void someMethod( int same_var_name ) {
         int i = same_var_name;
      }
   };
private:
   int same_var_name;
};

$ clang -c -Wshadow test.cpp
test.cpp:4:28: warning: declaration shadows a field of 'A' [-Wshadow]
      void someMethod( int same_var_name ) {
                           ^
test.cpp:9:8: note: previous declaration is here
   int same_var_name;
       ^
1 warning generated.

-- 
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/20140605/f560330c/attachment.html>


More information about the llvm-bugs mailing list