public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/109870] New: Miscomputation of return type of unevaluated lambda in type alias in template context
@ 2023-05-16  3:29 ed at catmur dot uk
  2023-05-16  3:43 ` [Bug c++/109870] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: ed at catmur dot uk @ 2023-05-16  3:29 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109870
           Summary: Miscomputation of return type of unevaluated lambda in
                    type alias in template context
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ed at catmur dot uk
  Target Milestone: ---

template<class> struct X {};
template<class T>
struct M {
    using R = decltype([] { return 1; }());
    template<class U> struct S { X<R> p; };
};
M<int>::S<void> s;

9.1 through 14.0.0 trunk reject with:

<source>: In instantiation of 'struct M<int>::S<void>':
<source>:7:17:   required from here
<source>:4:36: error: return-statement with a value, in function returning
'void' [-fpermissive]
    4 |     using R = decltype([] { return 1; }());
      |                                    ^

It appears the `U` type parameter in `M<T>::S<U>` is overwriting the lambda
deduced return type.

Possibly related to #92707, #103569

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

* [Bug c++/109870] Miscomputation of return type of unevaluated lambda in type alias in template context
  2023-05-16  3:29 [Bug c++/109870] New: Miscomputation of return type of unevaluated lambda in type alias in template context ed at catmur dot uk
@ 2023-05-16  3:43 ` pinskia at gcc dot gnu.org
  2024-04-13  8:22 ` pinskia at gcc dot gnu.org
  2024-04-13 18:16 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-05-16  3:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Most likely a dup of a bug that PR 107430 depends on.

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

* [Bug c++/109870] Miscomputation of return type of unevaluated lambda in type alias in template context
  2023-05-16  3:29 [Bug c++/109870] New: Miscomputation of return type of unevaluated lambda in type alias in template context ed at catmur dot uk
  2023-05-16  3:43 ` [Bug c++/109870] " pinskia at gcc dot gnu.org
@ 2024-04-13  8:22 ` pinskia at gcc dot gnu.org
  2024-04-13 18:16 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-13  8:22 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-04-13
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

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

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

* [Bug c++/109870] Miscomputation of return type of unevaluated lambda in type alias in template context
  2023-05-16  3:29 [Bug c++/109870] New: Miscomputation of return type of unevaluated lambda in type alias in template context ed at catmur dot uk
  2023-05-16  3:43 ` [Bug c++/109870] " pinskia at gcc dot gnu.org
  2024-04-13  8:22 ` pinskia at gcc dot gnu.org
@ 2024-04-13 18:16 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-13 18:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=106221

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Very much related to PR 106221 .

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

end of thread, other threads:[~2024-04-13 18:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-16  3:29 [Bug c++/109870] New: Miscomputation of return type of unevaluated lambda in type alias in template context ed at catmur dot uk
2023-05-16  3:43 ` [Bug c++/109870] " pinskia at gcc dot gnu.org
2024-04-13  8:22 ` pinskia at gcc dot gnu.org
2024-04-13 18:16 ` pinskia 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).