[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-bugs
Subject:    [Bug c++/100666] [9/10/11/12 Regression] warning: ignoring return value of 'constexpr _Tp&& std::for
From:       "cvs-commit at gcc dot gnu.org via Gcc-bugs" <gcc-bugs () gcc ! gnu ! org>
Date:       2021-05-31 14:08:55
Message-ID: bug-100666-4-2EYqOLL8fw () http ! gcc ! gnu ! org/bugzilla/
[Download RAW message or body]

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100666

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:718a78fcfb03ca3c552800b510ef3eb085bcbb76

commit r11-8492-g718a78fcfb03ca3c552800b510ef3eb085bcbb76
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue May 25 17:24:38 2021 +0200

    c++: Avoid -Wunused-value false positives on nullptr passed to ellipsis
[PR100666]

    When passing expressions with decltype(nullptr) type with side-effects to
    ellipsis, we pass (void *)0 instead, but for the side-effects evaluate them
    on the lhs of a COMPOUND_EXPR.  Unfortunately that means we warn about it
    if the expression is a call to nodiscard marked function, even when the
    result is really used, just needs to be transformed.

    Fixed by adding a warning_sentinel.

    2021-05-25  Jakub Jelinek  <jakub@redhat.com>

            PR c++/100666
            * call.c (convert_arg_to_ellipsis): For expressions with
NULLPTR_TYPE
            and side-effects, temporarily disable -Wunused-result warning when
            building COMPOUND_EXPR.

            * g++.dg/cpp1z/nodiscard8.C: New test.
            * g++.dg/cpp1z/nodiscard9.C: New test.

    (cherry picked from commit ad52d89808a947264397e920d7483090d4108f7b)=
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic