This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ C++ ] [ PATCH ] [ RFC ] p1301 - [[nodiscard("should have a reason")]]


... And I am very tired and forgot to attach the patch. Again. Sorry...!

On Fri, Oct 18, 2019 at 1:54 AM JeanHeyd Meneide
<phdofthehouse@gmail.com> wrote:
>
> Dear Jason,
>
> On Thu, Oct 17, 2019 at 3:51 PM Jason Merrill <jason@redhat.com> wrote:
> >  > FAIL: g++.dg/cpp0x/gen-attrs-67.C  -std=c++11  (test for errors, line 8)
> >  > FAIL: g++.dg/cpp1z/feat-cxx1z.C  -std=gnu++17 (test for excess errors)
> >  > FAIL: g++.dg/cpp1z/nodiscard4.C  -std=c++11 (test for excess errors)
> >  > FAIL: g++.dg/cpp1z/nodiscard4.C  -std=c++11  (test for warnings, line 12)
> >  > FAIL: g++.dg/cpp1z/nodiscard4.C  -std=c++11  (test for warnings, line 13)
> >  > FAIL: g++.dg/cpp2a/feat-cxx2a.C   (test for excess errors)
>
>      Sorry about that! I implemented a bit of a better warning to
> cover gen-attrs-67, and bumped the feature test macro value checks in
> the feat tests. The rest should be fine now too.
>
>      Let me know if anything else seems off!
>
> Best Wishes,
> JeanHeyd Meneide
>
> ===============================
>
> 2019-10-17  JeanHeyd Meneide  <phdofthehouse@gmail.com>
>
> gcc/
>
>         Implements p1301 [[nodiscard("should have a reason")]] + p1771 DR
>         * escaped_string.h (escaped_string): New header.
>         * tree.c (escaped_string): Remove escaped_string class.
>
> gcc/c-family
>
>         Implements p1301 [[nodiscard("should have a reason")]] + p1771 DR
>         * c-lex.c (c_common_has_attribute): Update attribute value.
>
> gcc/cp/
>
>         Implements p1301 [[nodiscard("should have a reason")]] + p1771 DR
>         * tree.c (handle_nodiscard_attribute) Added C++2a nodiscard
> string message.
>           (std_attribute_table) Increase nodiscard argument handling
> max_length from 0
>           to 1.
>         * parser.c (cp_parser_check_std_attribute): Add requirement
> that nodiscard
>           only be seen once in attribute-list.
>           (cp_parser_std_attribute): Check that empty parenthesis lists are
>           not specified for attributes that have max_length > 0 (e.g.
> [[attr()]]).
>         * cvt.c (maybe_warn_nodiscard): Add nodiscard message to
> output, if applicable.
>           (convert_to_void): Allow constructors to be nodiscard-able
> (fixes paper-as-DR
>           p1771).
>
> gcc/testsuite/g++.dg/cpp0x
>
>         Implements p1301 [[nodiscard("should have a reason")]] + p1771 DR
>         * gen-attrs-67.C: Test new error message for empty-parenthesis-list.
>
> gcc/testsuite/g++.dg/cpp2a
>
>         Implements p1301 [[nodiscard("should have a reason")]] + p1771 DR
>         * nodiscard-construct.C: New test.
>         * nodiscard-once.C: New test.
>         * nodiscard-reason-nonstring.C: New test.
>         * nodiscard-reason-only-one.C: New test.
>         * nodiscard-reason.C: New test.

Attachment: p1301.patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]