This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR c++/17729 Duplicate __attribute__((deprecated)) warning


Manuel López-Ibáñez wrote:
> :ADDPATCH c++:

> Index: gcc/cp/typeck.c
> ===================================================================
> --- gcc/cp/typeck.c	(revision 120969)
> +++ gcc/cp/typeck.c	(working copy)
> @@ -2242,9 +2242,6 @@ finish_class_member_access_expr (tree ob
>  	}
>      }
>  
> -  if (TREE_DEPRECATED (member))
> -    warn_deprecated_use (member);
> -

Where are the other deprecated warnings coming from in this case?

> Index: gcc/cp/call.c
> ===================================================================
> --- gcc/cp/call.c	(revision 120969)
> +++ gcc/cp/call.c	(working copy)
> @@ -315,8 +315,11 @@ build_call (tree function, tree parms)
>    if (decl && TREE_THIS_VOLATILE (decl) && cfun)
>      current_function_returns_abnormally = 1;
>  
> -  if (decl && TREE_DEPRECATED (decl))
> +  if (decl && TREE_DEPRECATED (decl) 
> +      && (really_overloaded_fn (decl) 
> +	  || TREE_CODE (fntype) == METHOD_TYPE))
>      warn_deprecated_use (decl);

This doesn't make sense to me.  We're never going to get an OVERLOAD
here; DECL is always going to be a simple function, or a pointer to a
function.  So, why are you checking really_overloaded_fn?

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]