public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/104565] New: One too many `this`es in parsing?
@ 2022-02-16 12:12 ted at lyncon dot se
  2022-02-16 17:25 ` [Bug c++/104565] [10/11/12 Regression] " pinskia at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: ted at lyncon dot se @ 2022-02-16 12:12 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104565
           Summary: One too many `this`es in parsing?
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ted at lyncon dot se
  Target Milestone: ---

Regression between g++ 9.4 and 10.1:
```
struct apa {
    constexpr auto n() const { return 3; }
};

template <class>
constexpr auto f() {
    apa foo;
    int{foo.n()};  // no matching function for call to 'apa::n(apa*)'
}

int main() {}
```

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/104565] [10/11/12 Regression] One too many `this`es in parsing?
  2022-02-16 12:12 [Bug c++/104565] New: One too many `this`es in parsing? ted at lyncon dot se
@ 2022-02-16 17:25 ` pinskia at gcc dot gnu.org
  2022-02-16 17:27 ` [Bug c++/104565] [10/11/12 Regression] constexpr template goes wrong with class and call to constexpr method pinskia at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-16 17:25 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |55004
           Keywords|                            |rejects-valid
            Summary|One too many `this`es in    |[10/11/12 Regression] One
                   |parsing?                    |too many `this`es in
                   |                            |parsing?
                URL|https://stackoverflow.com/q |
                   |uestions/71135361/taking-ad |
                   |dress-of-rvalue             |

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
https://stackoverflow.com/questions/71135361/taking-address-of-rvalue


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55004
[Bug 55004] [meta-bug] constexpr issues

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/104565] [10/11/12 Regression] constexpr template goes wrong with class and call to constexpr method
  2022-02-16 12:12 [Bug c++/104565] New: One too many `this`es in parsing? ted at lyncon dot se
  2022-02-16 17:25 ` [Bug c++/104565] [10/11/12 Regression] " pinskia at gcc dot gnu.org
@ 2022-02-16 17:27 ` pinskia at gcc dot gnu.org
  2022-02-16 20:06 ` ppalka at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-16 17:27 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[10/11/12 Regression] One   |[10/11/12 Regression]
                   |too many `this`es in        |constexpr template goes
                   |parsing?                    |wrong with class and call
                   |                            |to constexpr method
           Keywords|                            |needs-bisection
   Last reconfirmed|                            |2022-02-16
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/104565] [10/11/12 Regression] constexpr template goes wrong with class and call to constexpr method
  2022-02-16 12:12 [Bug c++/104565] New: One too many `this`es in parsing? ted at lyncon dot se
  2022-02-16 17:25 ` [Bug c++/104565] [10/11/12 Regression] " pinskia at gcc dot gnu.org
  2022-02-16 17:27 ` [Bug c++/104565] [10/11/12 Regression] constexpr template goes wrong with class and call to constexpr method pinskia at gcc dot gnu.org
@ 2022-02-16 20:06 ` ppalka at gcc dot gnu.org
  2022-02-17 10:04 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-02-16 20:06 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |ppalka at gcc dot gnu.org
             Status|NEW                         |ASSIGNED
           Keywords|needs-bisection             |
   Target Milestone|---                         |10.4
                 CC|                            |ppalka at gcc dot gnu.org

--- Comment #3 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Started with r10-7096.  Another issue with non-dependent expression folding it
seems.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/104565] [10/11/12 Regression] constexpr template goes wrong with class and call to constexpr method
  2022-02-16 12:12 [Bug c++/104565] New: One too many `this`es in parsing? ted at lyncon dot se
                   ` (2 preceding siblings ...)
  2022-02-16 20:06 ` ppalka at gcc dot gnu.org
@ 2022-02-17 10:04 ` rguenth at gcc dot gnu.org
  2022-02-17 13:35 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-02-17 10:04 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/104565] [10/11/12 Regression] constexpr template goes wrong with class and call to constexpr method
  2022-02-16 12:12 [Bug c++/104565] New: One too many `this`es in parsing? ted at lyncon dot se
                   ` (3 preceding siblings ...)
  2022-02-17 10:04 ` rguenth at gcc dot gnu.org
@ 2022-02-17 13:35 ` cvs-commit at gcc dot gnu.org
  2022-02-17 13:36 ` [Bug c++/104565] [10/11 " ppalka at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-02-17 13:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:6bbd8afee0036c274f5ebb5b48d6fdc2091bd046

commit r12-7277-g6bbd8afee0036c274f5ebb5b48d6fdc2091bd046
Author: Patrick Palka <ppalka@redhat.com>
Date:   Thu Feb 17 08:35:23 2022 -0500

    c++: double non-dep folding from finish_compound_literal [PR104565]

    In finish_compound_literal, we perform non-dependent expr folding before
    the call to check_narrowing ever since r9-5973.  But ever since r10-7096,
    check_narrowing also performs non-dependent expr folding of its own.
    This double folding means tsubst will see non-templated trees during the
    second folding, which causes a spurious error in the below testcase.

    This patch removes the former folding operation; it seems obviated by
    the latter one.

            PR c++/104565

    gcc/cp/ChangeLog:

            * semantics.cc (finish_compound_literal): Don't perform
            non-dependent expr folding before calling check_narrowing.

    gcc/testsuite/ChangeLog:

            * g++.dg/template/non-dependent22.C: New test.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/104565] [10/11 Regression] constexpr template goes wrong with class and call to constexpr method
  2022-02-16 12:12 [Bug c++/104565] New: One too many `this`es in parsing? ted at lyncon dot se
                   ` (4 preceding siblings ...)
  2022-02-17 13:35 ` cvs-commit at gcc dot gnu.org
@ 2022-02-17 13:36 ` ppalka at gcc dot gnu.org
  2022-03-18 12:16 ` ppalka at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-02-17 13:36 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[10/11/12 Regression]       |[10/11 Regression]
                   |constexpr template goes     |constexpr template goes
                   |wrong with class and call   |wrong with class and call
                   |to constexpr method         |to constexpr method

--- Comment #5 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed for GCC 12 so far.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/104565] [10/11 Regression] constexpr template goes wrong with class and call to constexpr method
  2022-02-16 12:12 [Bug c++/104565] New: One too many `this`es in parsing? ted at lyncon dot se
                   ` (5 preceding siblings ...)
  2022-02-17 13:36 ` [Bug c++/104565] [10/11 " ppalka at gcc dot gnu.org
@ 2022-03-18 12:16 ` ppalka at gcc dot gnu.org
  2022-04-07 19:19 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-03-18 12:16 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |davide.gadioli at polimi dot it

--- Comment #6 from Patrick Palka <ppalka at gcc dot gnu.org> ---
*** Bug 102980 has been marked as a duplicate of this bug. ***

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/104565] [10/11 Regression] constexpr template goes wrong with class and call to constexpr method
  2022-02-16 12:12 [Bug c++/104565] New: One too many `this`es in parsing? ted at lyncon dot se
                   ` (6 preceding siblings ...)
  2022-03-18 12:16 ` ppalka at gcc dot gnu.org
@ 2022-04-07 19:19 ` cvs-commit at gcc dot gnu.org
  2022-05-09 23:32 ` [Bug c++/104565] [10 " cvs-commit at gcc dot gnu.org
  2022-05-09 23:35 ` ppalka at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-07 19:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Patrick Palka
<ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:c0f38a14c8e9daf4c3f96fe9de4e9785616d5912

commit r11-9795-gc0f38a14c8e9daf4c3f96fe9de4e9785616d5912
Author: Patrick Palka <ppalka@redhat.com>
Date:   Thu Feb 17 08:35:23 2022 -0500

    c++: double non-dep folding from finish_compound_literal [PR104565]

    In finish_compound_literal, we perform non-dependent expr folding before
    the call to check_narrowing ever since r9-5973.  But ever since r10-7096,
    check_narrowing also performs non-dependent expr folding of its own.
    This double folding means tsubst will see non-templated trees during the
    second folding, which causes a spurious error in the below testcase.

    This patch removes the former folding operation; it seems obviated by
    the latter one.

            PR c++/104565

    gcc/cp/ChangeLog:

            * semantics.c (finish_compound_literal): Don't perform
            non-dependent expr folding before calling check_narrowing.

    gcc/testsuite/ChangeLog:

            * g++.dg/template/non-dependent22.C: New test.

    (cherry picked from commit 6bbd8afee0036c274f5ebb5b48d6fdc2091bd046)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/104565] [10 Regression] constexpr template goes wrong with class and call to constexpr method
  2022-02-16 12:12 [Bug c++/104565] New: One too many `this`es in parsing? ted at lyncon dot se
                   ` (7 preceding siblings ...)
  2022-04-07 19:19 ` cvs-commit at gcc dot gnu.org
@ 2022-05-09 23:32 ` cvs-commit at gcc dot gnu.org
  2022-05-09 23:35 ` ppalka at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-09 23:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Patrick Palka
<ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:22682e291ef4b5dcb6be3a12089dbbc46889002c

commit r10-10603-g22682e291ef4b5dcb6be3a12089dbbc46889002c
Author: Patrick Palka <ppalka@redhat.com>
Date:   Thu Feb 17 08:35:23 2022 -0500

    c++: double non-dep folding from finish_compound_literal [PR104565]

    In finish_compound_literal, we perform non-dependent expr folding before
    the call to check_narrowing ever since r9-5973.  But ever since r10-7096,
    check_narrowing also performs non-dependent expr folding of its own.
    This double folding means tsubst will see non-templated trees during the
    second folding, which causes a spurious error in the below testcase.

    This patch removes the former folding operation; it seems obviated by
    the latter one.

            PR c++/104565

    gcc/cp/ChangeLog:

            * semantics.c (finish_compound_literal): Don't perform
            non-dependent expr folding before calling check_narrowing.

    gcc/testsuite/ChangeLog:

            * g++.dg/template/non-dependent22.C: New test.

    (cherry picked from commit 6bbd8afee0036c274f5ebb5b48d6fdc2091bd046)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/104565] [10 Regression] constexpr template goes wrong with class and call to constexpr method
  2022-02-16 12:12 [Bug c++/104565] New: One too many `this`es in parsing? ted at lyncon dot se
                   ` (8 preceding siblings ...)
  2022-05-09 23:32 ` [Bug c++/104565] [10 " cvs-commit at gcc dot gnu.org
@ 2022-05-09 23:35 ` ppalka at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-05-09 23:35 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #9 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed for GCC 10.4/11.3/12, thanks for the bug report.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-05-09 23:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-16 12:12 [Bug c++/104565] New: One too many `this`es in parsing? ted at lyncon dot se
2022-02-16 17:25 ` [Bug c++/104565] [10/11/12 Regression] " pinskia at gcc dot gnu.org
2022-02-16 17:27 ` [Bug c++/104565] [10/11/12 Regression] constexpr template goes wrong with class and call to constexpr method pinskia at gcc dot gnu.org
2022-02-16 20:06 ` ppalka at gcc dot gnu.org
2022-02-17 10:04 ` rguenth at gcc dot gnu.org
2022-02-17 13:35 ` cvs-commit at gcc dot gnu.org
2022-02-17 13:36 ` [Bug c++/104565] [10/11 " ppalka at gcc dot gnu.org
2022-03-18 12:16 ` ppalka at gcc dot gnu.org
2022-04-07 19:19 ` cvs-commit at gcc dot gnu.org
2022-05-09 23:32 ` [Bug c++/104565] [10 " cvs-commit at gcc dot gnu.org
2022-05-09 23:35 ` ppalka at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).