summaryrefslogtreecommitdiff
path: root/gcc/attribs.h
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2018-11-09 17:32:52 +0000
committerMartin Sebor <msebor@gcc.gnu.org>2018-11-09 10:32:52 -0700
commit79a2c4281c7dcaa6a138d24fd037c62453a12bde (patch)
treedff179677c863457f73ef49310ef719591c305e7 /gcc/attribs.h
parent900dab1338b45c8fa8d1b315dce53712b857da1d (diff)
downloadgcc-79a2c4281c7dcaa6a138d24fd037c62453a12bde.tar.gz
PR middle-end/81824 - Warn for missing attributes with function aliases
gcc/c-family/ChangeLog: PR middle-end/81824 * c-attribs.c (handle_copy_attribute): New function. gcc/cp/ChangeLog: PR middle-end/81824 * pt.c (warn_spec_missing_attributes): Move code to attribs.c. Call decls_mismatched_attributes. gcc/ChangeLog: PR middle-end/81824 * attribs.c (has_attribute): New helper function. (decls_mismatched_attributes, maybe_diag_alias_attributes): Same. * attribs.h (decls_mismatched_attributes): Declare. * cgraphunit.c (handle_alias_pairs): Call maybe_diag_alias_attributes. (maybe_diag_incompatible_alias): Use OPT_Wattribute_alias_. * common.opt (-Wattribute-alias): Take an argument. (-Wno-attribute-alias): New option. * doc/extend.texi (Common Function Attributes): Document copy. (Common Variable Attributes): Same. * doc/invoke.texi (-Wmissing-attributes): Document enhancement. (-Wattribute-alias): Document new option argument. gcc/testsuite/ChangeLog: PR middle-end/81824 * gcc.dg/Wattribute-alias.c: New test. * gcc.dg/Wmissing-attributes.c: New test. * gcc.dg/attr-copy.c: New test. * gcc.dg/attr-copy-2.c: New test. * gcc.dg/attr-copy-3.c: New test. * gcc.dg/attr-copy-4.c: New test. From-SVN: r265980
Diffstat (limited to 'gcc/attribs.h')
-rw-r--r--gcc/attribs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/attribs.h b/gcc/attribs.h
index c277e1b752d..5b76c4c400c 100644
--- a/gcc/attribs.h
+++ b/gcc/attribs.h
@@ -105,6 +105,12 @@ extern int attribute_list_contained (const_tree, const_tree);
extern tree private_lookup_attribute (const char *attr_name, size_t attr_len,
tree list);
+extern unsigned decls_mismatched_attributes (tree, tree, tree,
+ const char* const[],
+ pretty_printer*);
+
+extern void maybe_diag_alias_attributes (tree, tree);
+
/* For a given IDENTIFIER_NODE, strip leading and trailing '_' characters
so that we have a canonical form of attribute names. */