From 2e034e3241b0306834bd7f754d5dae56e04e6520 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 12 Feb 2010 18:26:12 +0100 Subject: [PATCH] re PR c++/43033 (--enable-checking=valgrind C++ failures) PR c++/43033 * name-lookup.c (pushdecl_maybe_friend): Check default args of t instead of x. * g++.dg/other/default3.C: Xfail g4 test. From-SVN: r156734 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/name-lookup.c | 6 +++--- gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/g++.dg/other/default3.C | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f42f59e5ce6..18d12325bfe 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2010-02-12 Jakub Jelinek + + PR c++/43033 + * name-lookup.c (pushdecl_maybe_friend): Check default args of t + instead of x. + 2010-02-10 Jason Merrill PR c++/41896 diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 8f693464875..1f595c0eb92 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -1,5 +1,5 @@ /* Definitions for C++ name lookup routines. - Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis @@ -853,8 +853,8 @@ pushdecl_maybe_friend (tree x, bool is_friend) add_decl_to_level (x, NAMESPACE_LEVEL (CP_DECL_CONTEXT (t))); } - if (TREE_CODE (x) == FUNCTION_DECL || DECL_FUNCTION_TEMPLATE_P (x)) - check_default_args (x); + if (TREE_CODE (t) == FUNCTION_DECL || DECL_FUNCTION_TEMPLATE_P (t)) + check_default_args (t); if (t != x || DECL_FUNCTION_TEMPLATE_P (t)) POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 502f048c70a..b93be3d30fd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -3,6 +3,9 @@ * gcc.dg/guality/guality.h (GUALCVT): Zero extend instead of sign extend pointers to gualchk_t. + PR c++/43033 + * g++.dg/other/default3.C: Xfail g4 test. + 2010-02-11 Sebastian Pop PR middle-end/43012 diff --git a/gcc/testsuite/g++.dg/other/default3.C b/gcc/testsuite/g++.dg/other/default3.C index 324ba7146fe..559cb11265d 100644 --- a/gcc/testsuite/g++.dg/other/default3.C +++ b/gcc/testsuite/g++.dg/other/default3.C @@ -25,7 +25,7 @@ template void g3(int, int); template void g3(int = 0, int); // { dg-error "default" } template void g4(int, int); -template void g4(int = 0, int) {} // { dg-error "default" } +template void g4(int = 0, int) {} // { dg-error "default" "" { xfail *-*-* } } template void g5(); template void g5(int = 0, int); // { dg-error "default" } -- 2.30.2