nodiscard2.C
181 Bytes
-
Implement C++17 [[nodiscard]] attribute. · b632761d
PR c++/38172 PR c++/54379 gcc/c-family/ * c-lex.c (c_common_has_attribute): Handle nodiscard. gcc/cp/ * parser.c (cp_parser_std_attribute): Handle [[nodiscard]]. * tree.c (handle_nodiscard_attribute): New. (cxx_attribute_table): Add [[nodiscard]]. * cvt.c (cp_get_fndecl_from_callee, cp_get_callee_fndecl): New. (maybe_warn_nodiscard): New. (convert_to_void): Call it. From-SVN: r235597
Jason Merrill committed