Bug 36892 - Support __attribute__((deprecated("text string")))
Summary: Support __attribute__((deprecated("text string")))
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.4.0
: P3 enhancement
Target Milestone: 4.5.0
Assignee: Not yet assigned to anyone
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords:
: 30063 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-07-21 19:03 UTC by H.J. Lu
Modified: 2009-12-31 05:55 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-11-15 00:40:43


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2008-07-21 19:03:43 UTC
MS provides

__declspec(deprecated("text string"))

while GCC doesn't support "text string". It will be nice
to support

__attribute__((deprecated("text string")))
Comment 1 H.J. Lu 2008-09-15 18:40:52 UTC
A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2008-09/msg01095.html
Comment 2 Andrew Pinski 2008-11-15 00:40:43 UTC
Confirmed.
Comment 3 H.J. Lu 2009-03-28 15:23:02 UTC
A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2009-02/msg00251.html
Comment 4 H.J. Lu 2009-04-01 16:46:23 UTC
The updated patch is at

http://gcc.gnu.org/ml/gcc-patches/2009-04/msg00087.html
Comment 5 H.J. Lu 2009-05-06 00:30:39 UTC
The updated patch is at

http://gcc.gnu.org/ml/gcc-patches/2009-05/msg00208.html
Comment 6 hjl@gcc.gnu.org 2009-05-08 18:45:15 UTC
Subject: Bug 36892

Author: hjl
Date: Fri May  8 18:44:50 2009
New Revision: 147293

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147293
Log:
gcc/

2009-05-08  H.J. Lu  <hongjiu.lu@intel.com>
	    Andrew Morrow  <acm@google.com>

	PR c/36892
	* c-common.c (c_common_attribute_table): Permit deprecated
	attribute to take an optional argument.
	(handle_deprecated_attribute): If the optional argument to
	__attribute__((deprecated)) is not a string ignore the attribute
	and emit a warning.

	* c-decl.c (grokdeclarator): Updated warn_deprecated_use call.
	* c-typeck.c (build_component_ref): Likewise.
	(build_external_ref): Likewise.

	* toplev.c (warn_deprecated_use): Add an attribute argument.
	Emit the message associated with __attribute__((deprecated)).

	* toplev.h (warn_deprecated_use): Updated.

	* doc/extend.texi: Document new optional parameter to
	__attribute__((deprecated))

gcc/cp/

2009-05-08  H.J. Lu  <hongjiu.lu@intel.com>

	PR c/36892
	* call.c (build_call_a): Updated warn_deprecated_use call.
	(build_over_call): Likewise.
	* decl.c (grokdeclarator): Likewise.
	(grokparms): Likewise.
	* semantics.c (finish_id_expression): Likewise.
	* typeck.c (build_class_member_access_expr): Likewise.
	(finish_class_member_access_expr): Likewise.

gcc/testsuite/

2009-05-08  H.J. Lu  <hongjiu.lu@intel.com>

	PR c/36892
	* g++.dg/warn/deprecated-6.C: New.
	* gcc.dg/deprecated-4.c: Likewise.
	* gcc.dg/deprecated-5.c: Likewise.
	* gcc.dg/deprecated-6.c: Likewise.

Added:
    trunk/gcc/testsuite/g++.dg/warn/deprecated-6.C
    trunk/gcc/testsuite/gcc.dg/deprecated-4.c
    trunk/gcc/testsuite/gcc.dg/deprecated-5.c
    trunk/gcc/testsuite/gcc.dg/deprecated-6.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-common.c
    trunk/gcc/c-decl.c
    trunk/gcc/c-typeck.c
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/call.c
    trunk/gcc/cp/decl.c
    trunk/gcc/cp/semantics.c
    trunk/gcc/cp/typeck.c
    trunk/gcc/doc/extend.texi
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/toplev.c
    trunk/gcc/toplev.h

Comment 7 H.J. Lu 2009-05-08 21:07:09 UTC
Fixed.
Comment 8 H.J. Lu 2009-12-31 05:55:41 UTC
*** Bug 30063 has been marked as a duplicate of this bug. ***