https://bugs.llvm.org/show_bug.cgi?id=34120
Bug ID: 34120
Summary: -Wshadow false-negative compared to gcc
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
Assignee: unassignedclangb...@nondot.org
Reporter: lebedev...@gmail.com
CC: llvm-bugs@lists.llvm.org
class A {
int B;
};
class C : A {
void D(int B) {}
};
$ clang++-6.0 -Wshadow -c wshadow.cpp
$ clang++-5.0 -Wshadow -c wshadow.cpp
$ clang++-4.0 -Wshadow -c wshadow.cpp
$ clang++-3.9 -Wshadow -c wshadow.cpp
$ g++-7 -Wshadow -c wshadow.cpp
wshadow.cpp: In member function ‘void C::D(int)’:
wshadow.cpp:5:17: warning: declaration of ‘B’ shadows a member of ‘C’
[-Wshadow]
void D(int B) {}
^
wshadow.cpp:2:7: note: shadowed declaration is here
int B;
^
$ g++-6 -Wshadow -c wshadow.cpp
wshadow.cpp: In member function ‘void C::D(int)’:
wshadow.cpp:5:17: warning: declaration of ‘B’ shadows a member of ‘C’
[-Wshadow]
void D(int B) {}
^
wshadow.cpp:2:7: note: shadowed declaration is here
int B;
^
$ g++-5 -Wshadow -c wshadow.cpp
wshadow.cpp: In member function ‘void C::D(int)’:
wshadow.cpp:5:17: warning: declaration of ‘B’ shadows a member of ‘C’
[-Wshadow]
void D(int B) {}
^
wshadow.cpp:2:7: note: shadowed declaration is here
int B;
^
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs