aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorH.J. Lu <hjl@gcc.gnu.org>2009-05-08 11:44:50 -0700
committerH.J. Lu <hjl@gcc.gnu.org>2009-05-08 11:44:50 -0700
commit9b86d6bb25587db93a322bf5778e9892aaa8b776 (patch)
tree3d22aee346c9c7a9e1f97b4a70e8968a3e82e462 /gcc/cp
parent82ad047f00d42f4cdb4ae2ee163f46d74db35f76 (diff)
downloadgcc-9b86d6bb25587db93a322bf5778e9892aaa8b776.zip
gcc-9b86d6bb25587db93a322bf5778e9892aaa8b776.tar.gz
gcc-9b86d6bb25587db93a322bf5778e9892aaa8b776.tar.bz2
re PR c/36892 (Support __attribute__((deprecated("text string"))))
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. From-SVN: r147293
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog51
-rw-r--r--gcc/cp/call.c4
-rw-r--r--gcc/cp/decl.c6
-rw-r--r--gcc/cp/semantics.c2
-rw-r--r--gcc/cp/typeck.c4
5 files changed, 39 insertions, 28 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ca9c05a..cc7b5f7 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,14 @@
+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.
+
2009-05-06 Dodji Seketeli <dodji@redhat.com>
PR c++/17395
@@ -7,23 +18,23 @@
2009-05-05 Shujing Zhao <pearly.zhao@oracle.com>
* cp-tree.h:
- (opname_tab, assignop_tab, update_member_visibility, yyerror, yyhook,
- mangle_compound_literal): Remove unused declarations.
- (build_vfield_ref, cxx_print_statistics, clone_function_decl,
- adjust_clone_args, maybe_push_cleanup_level, pushtag, make_anon_name,
- pushdecl_top_level_maybe_friend, pushdecl_top_level_and_finish,
- check_for_out_of_scope_variable, print_other_binding_stack,
- maybe_push_decl, cxx_mark_addressable, force_target_expr,
- build_target_expr_with_type, finish_case_label,
- cxx_maybe_build_cleanup, begin_eh_spec_block, finish_eh_spec_block,
- check_template_keyword, cxx_omp_predetermined_sharing,
- cxx_omp_clause_default_ctor, cxx_omp_clause_copy_ctor,
- cxx_omp_clause_assign_op, cxx_omp_clause_dtor, cxx_omp_finish_clause,
- cxx_omp_privatize_by_reference): Rearrange the declarations line to
- match the comment that indicates the .c file which the functions are
- defined.
- (cxx_print_xnode, cxx_print_decl, cxx_print_type,
- cxx_print_identifier, cxx_print_error_function, pushdecl): Add comment.
+ (opname_tab, assignop_tab, update_member_visibility, yyerror, yyhook,
+ mangle_compound_literal): Remove unused declarations.
+ (build_vfield_ref, cxx_print_statistics, clone_function_decl,
+ adjust_clone_args, maybe_push_cleanup_level, pushtag, make_anon_name,
+ pushdecl_top_level_maybe_friend, pushdecl_top_level_and_finish,
+ check_for_out_of_scope_variable, print_other_binding_stack,
+ maybe_push_decl, cxx_mark_addressable, force_target_expr,
+ build_target_expr_with_type, finish_case_label,
+ cxx_maybe_build_cleanup, begin_eh_spec_block, finish_eh_spec_block,
+ check_template_keyword, cxx_omp_predetermined_sharing,
+ cxx_omp_clause_default_ctor, cxx_omp_clause_copy_ctor,
+ cxx_omp_clause_assign_op, cxx_omp_clause_dtor, cxx_omp_finish_clause,
+ cxx_omp_privatize_by_reference): Rearrange the declarations line to
+ match the comment that indicates the .c file which the functions are
+ defined.
+ (cxx_print_xnode, cxx_print_decl, cxx_print_type,
+ cxx_print_identifier, cxx_print_error_function, pushdecl): Add comment.
2009-05-05 Nathan Sidwell <nathan@codesourcery.com>
@@ -821,9 +832,9 @@
2009-02-01 Paolo Carlini <paolo.carlini@oracle.com>
- PR c++/39053
- * parser.c (cp_parser_pure_specifier): If there are no tokens left
- do not call cp_lexer_consume_token.
+ PR c++/39053
+ * parser.c (cp_parser_pure_specifier): If there are no tokens left
+ do not call cp_lexer_consume_token.
2009-01-30 Jakub Jelinek <jakub@redhat.com>
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index ca45bee..ba8dac1 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -342,7 +342,7 @@ build_call_a (tree function, int n, tree *argarray)
current_function_returns_abnormally = 1;
if (decl && TREE_DEPRECATED (decl))
- warn_deprecated_use (decl);
+ warn_deprecated_use (decl, NULL_TREE);
require_complete_eh_spec_types (fntype, decl);
if (decl && DECL_CONSTRUCTOR_P (decl))
@@ -5457,7 +5457,7 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
/* Warn about deprecated virtual functions now, since we're about
to throw away the decl. */
if (TREE_DEPRECATED (fn))
- warn_deprecated_use (fn);
+ warn_deprecated_use (fn, NULL_TREE);
argarray[0] = build_base_path (PLUS_EXPR, argarray[0], binfo, 1);
if (TREE_SIDE_EFFECTS (argarray[0]))
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index e06dce2..fb91647 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -7835,7 +7835,7 @@ grokdeclarator (const cp_declarator *declarator,
suppress reports of deprecated items. */
if (type && TREE_DEPRECATED (type)
&& deprecated_state != DEPRECATED_SUPPRESS)
- warn_deprecated_use (type);
+ warn_deprecated_use (type, NULL_TREE);
if (type && TREE_CODE (type) == TYPE_DECL)
{
typedef_decl = type;
@@ -7843,7 +7843,7 @@ grokdeclarator (const cp_declarator *declarator,
if (TREE_DEPRECATED (type)
&& DECL_ARTIFICIAL (typedef_decl)
&& deprecated_state != DEPRECATED_SUPPRESS)
- warn_deprecated_use (type);
+ warn_deprecated_use (type, NULL_TREE);
}
/* No type at all: default to `int', and set DEFAULTED_INT
because it was not a user-defined typedef. */
@@ -9697,7 +9697,7 @@ grokparms (tree parmlist, tree *parms)
{
tree deptype = type_is_deprecated (type);
if (deptype)
- warn_deprecated_use (deptype);
+ warn_deprecated_use (deptype, NULL_TREE);
}
/* Top-level qualifiers on the parameters are
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 4c0c91d..8c0a1e5 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -3038,7 +3038,7 @@ finish_id_expression (tree id_expression,
}
if (TREE_DEPRECATED (decl))
- warn_deprecated_use (decl);
+ warn_deprecated_use (decl, NULL_TREE);
return decl;
}
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index e34d942..4486b90 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -1909,7 +1909,7 @@ build_class_member_access_expr (tree object, tree member,
member_scope = DECL_CLASS_CONTEXT (member);
mark_used (member);
if (TREE_DEPRECATED (member))
- warn_deprecated_use (member);
+ warn_deprecated_use (member, NULL_TREE);
}
else
member_scope = BINFO_TYPE (BASELINK_ACCESS_BINFO (member));
@@ -2369,7 +2369,7 @@ finish_class_member_access_expr (tree object, tree name, bool template_p,
}
if (TREE_DEPRECATED (member))
- warn_deprecated_use (member);
+ warn_deprecated_use (member, NULL_TREE);
if (template_p)
check_template_keyword (member);