re PR c++/61945 (tree check fail with -Woverloaded-virtual)
PR c++/61945 * class.c (warn_hidden): Check for FUNCTION_DECL. * g++.dg/warn/pr61945.C: New test. From-SVN: r215597
This commit is contained in:
parent
c5b2614754
commit
6597738a3a
@ -1,3 +1,8 @@
|
||||
2014-09-25 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR c++/61945
|
||||
* class.c (warn_hidden): Check for FUNCTION_DECL.
|
||||
|
||||
2014-09-25 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/63249
|
||||
|
@ -2821,7 +2821,8 @@ warn_hidden (tree t)
|
||||
for (fn = fns; fn; fn = OVL_NEXT (fn))
|
||||
{
|
||||
fndecl = OVL_CURRENT (fn);
|
||||
if (DECL_VINDEX (fndecl))
|
||||
if (TREE_CODE (fndecl) == FUNCTION_DECL
|
||||
&& DECL_VINDEX (fndecl))
|
||||
{
|
||||
tree *prev = &base_fndecls;
|
||||
|
||||
|
@ -1,3 +1,8 @@
|
||||
2014-09-25 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR c++/61945
|
||||
* g++.dg/warn/pr61945.C: New test.
|
||||
|
||||
2014-09-25 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR tree-optimization/63341
|
||||
|
11
gcc/testsuite/g++.dg/warn/pr61945.C
Normal file
11
gcc/testsuite/g++.dg/warn/pr61945.C
Normal file
@ -0,0 +1,11 @@
|
||||
// PR c++/61945
|
||||
// { dg-do compile }
|
||||
// { dg-options "-Woverloaded-virtual" }
|
||||
|
||||
class A {
|
||||
virtual int foo (); // { dg-warning "was hidden" }
|
||||
};
|
||||
class B : A {
|
||||
template <typename>
|
||||
void foo (); // { dg-warning "by .B::foo\\(\\)." }
|
||||
};
|
Loading…
Reference in New Issue
Block a user