Commit 6597738a by Marek Polacek Committed by Marek Polacek

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
parent c5b26147
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;
......
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
......
// 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\\(\\)." }
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment