diff options
author | Dodji Seketeli <dodji@redhat.com> | 2012-09-28 12:51:30 +0000 |
---|---|---|
committer | Dodji Seketeli <dodji@gcc.gnu.org> | 2012-09-28 14:51:30 +0200 |
commit | 3b4441db79de403b90038af98f8641c19ff0953b (patch) | |
tree | 62e97833b7985d32ad245d045f3f22483e828606 /gcc/tree-call-cdce.c | |
parent | 2be9064dedcf93581e0596151454573d8c37f8be (diff) | |
download | gcc-3b4441db79de403b90038af98f8641c19ff0953b.zip gcc-3b4441db79de403b90038af98f8641c19ff0953b.tar.gz gcc-3b4441db79de403b90038af98f8641c19ff0953b.tar.bz2 |
PR c++/29028 - Missed unused warning on using declaration
In the example of the patch, g++ fails to warn that the variable N::i
(introduced via a using declaration) is unused.
This is because as we want to emit the warning in poplevel, when we
walk the local bindings returned by getdecls, we forget that a
VAR_DECL introduced by a using declaration is represented by a
TREE_LIST which TREE_VALUE is the VAR_DECL, and we wrongly look for a
bare VAR_DECL.
Fixed thus and tested on x86_64-unknown-linux-gnu against trunk.
gcc/cp/
* decl.c (poplevel<warn_unused*>): Do not forget that some local
bindings are represented by a TREE_LIST.
gcc/testsuite/
* g++.dg/warn/Wunused-var-18.C: New test.
From-SVN: r191829
Diffstat (limited to 'gcc/tree-call-cdce.c')
0 files changed, 0 insertions, 0 deletions