summaryrefslogtreecommitdiff
path: root/gcc/doc/extend.texi
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2013-07-13 23:16:18 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2013-07-13 23:16:18 +0000
commita96c3cc137bf0b63e19601371c082f0ed963dc25 (patch)
tree0170fc55d95b627aec9918256ba3cf861f269fd3 /gcc/doc/extend.texi
parent84fcb947302a8da0d1c0c5dd0d130cc82ea10c06 (diff)
downloadgcc-a96c3cc137bf0b63e19601371c082f0ed963dc25.tar.gz
PR c++/55203
c-family/ * c-common.c (c_common_attribute_table): Add warn_unused. (handle_warn_unused_attribute): New. cp/ * init.c (build_aggr_init): Check for warn_unused attribute. * decl.c (poplevel): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200941 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/doc/extend.texi')
-rw-r--r--gcc/doc/extend.texi17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 1c85a3e7382..721c9b10daf 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -16377,6 +16377,23 @@ only be applied to classes declared within an @code{extern "Java"} block.
Calls to methods declared in this interface are dispatched using GCJ's
interface table mechanism, instead of regular virtual table dispatch.
+@item warn_unused
+@cindex @code{warn_unused} attribute
+
+For C++ types with non-trivial constructors and/or destructors it is
+impossible for the compiler to determine whether a variable of this
+type is truly unused if it is not referenced. This type attribute
+informs the compiler that variables of this type should be warned
+about if they appear to be unused, just like variables of fundamental
+types.
+
+This attribute is appropriate for types which just represent a value,
+such as @code{std::string}; it is not appropriate for types which
+control a resource, such as @code{std::mutex}.
+
+This attribute is also accepted in C, but it is unnecessary because C
+does not have constructors or destructors.
+
@end table
See also @ref{Namespace Association}.