public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/110681] New: bogus warning -Wreturn-type for lambda in tparam list
@ 2023-07-16  0:53 eric.niebler at gmail dot com
  2023-07-16  0:55 ` [Bug c++/110681] " pinskia at gcc dot gnu.org
  2024-04-13  8:27 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: eric.niebler at gmail dot com @ 2023-07-16  0:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110681
           Summary: bogus warning -Wreturn-type for lambda in tparam list
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eric.niebler at gmail dot com
  Target Milestone: ---

The following valid C++20 code causes gcc trunk to erroneously warn about a
missing return statement.


  template <auto X = []{}>
  constexpr auto y = X;

  template <class T>
  using C = decltype(y<>);

  using D = C<int>;


<source>: In substitution of 'template<class T> using C = decltype (y<<lambda>
>) [with T = int]':
<source>:27:18:   required from here
<source>:21:22: warning: no return statement in function returning non-void
[-Wreturn-type]
   21 |   template <auto X = []{}>
      |                      ^~~~
Compiler returned: 0

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

* [Bug c++/110681] bogus warning -Wreturn-type for lambda in tparam list
  2023-07-16  0:53 [Bug c++/110681] New: bogus warning -Wreturn-type for lambda in tparam list eric.niebler at gmail dot com
@ 2023-07-16  0:55 ` pinskia at gcc dot gnu.org
  2024-04-13  8:27 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-16  0:55 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |c++-lambda
             Blocks|                            |107430

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Lambda inside a decltype definitely one place where GCC is known to be broken.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107430
[Bug 107430] [meta-bug] lambda in decltype

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

* [Bug c++/110681] bogus warning -Wreturn-type for lambda in tparam list
  2023-07-16  0:53 [Bug c++/110681] New: bogus warning -Wreturn-type for lambda in tparam list eric.niebler at gmail dot com
  2023-07-16  0:55 ` [Bug c++/110681] " pinskia at gcc dot gnu.org
@ 2024-04-13  8:27 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-13  8:27 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed on the trunk for GCC 14 by the recent lambda template patches.

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-16  0:53 [Bug c++/110681] New: bogus warning -Wreturn-type for lambda in tparam list eric.niebler at gmail dot com
2023-07-16  0:55 ` [Bug c++/110681] " pinskia at gcc dot gnu.org
2024-04-13  8:27 ` 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).