Joseph Myers c19e44ac8d c: Implement C2x nodiscard attribute
C2x adds the nodiscard standard attribute, with an optional string
argument, as in C++; implement it for C.

Bootstrapped with no regressions for x86_64-pc-linux-gnu.

gcc/c/
2020-11-04  Joseph Myers  <joseph@codesourcery.com>

	* c-decl.c (handle_nodiscard_attribute): New.
	(std_attribute_table): Add nodiscard.
	* c-parser.c (c_parser_std_attribute): Expect argument to
	nodiscard attribute to be a string.  Do not special-case ignoring
	nodiscard.
	* c-typeck.c (maybe_warn_nodiscard): New.
	(build_compound_expr, emit_side_effect_warnings): Call
	maybe_warn_nodiscard.
	(c_process_expr_stmt, c_finish_stmt_expr): Also call
	emit_side_effect_warnings if warn_unused_result.

gcc/testsuite/
2020-11-04  Joseph Myers  <joseph@codesourcery.com>

	* gcc.dg/c2x-attr-nodiscard-1.c, gcc.dg/c2x-attr-nodiscard-2.c,
	gcc.dg/c2x-attr-nodiscard-3.c, gcc.dg/c2x-attr-nodiscard-4.c: New
	tests.
	* gcc.dg/c2x-attr-syntax-5.c: Remove nodiscard test.
2020-11-04 06:48:46 +00:00
2020-11-04 00:16:41 +00:00
2020-11-04 06:48:46 +00:00
2020-11-04 00:16:41 +00:00
2020-11-04 00:16:41 +00:00
2020-11-02 20:53:00 +00:00
2020-11-02 20:53:00 +00:00
2020-11-04 00:16:41 +00:00

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.
Description
No description provided
Readme 2.1 GiB
Languages
C++ 31.9%
C 31.3%
Ada 12%
D 6.5%
Go 6.4%
Other 11.5%