public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/105236] New: failed lookup of alias with alias template of dependent template parameter containing lambda in unevaluated context
@ 2022-04-12  6:01 cooky.ykooc922 at gmail dot com
  2022-04-12  7:59 ` [Bug c++/105236] " jakub at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: cooky.ykooc922 at gmail dot com @ 2022-04-12  6:01 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105236
           Summary: failed lookup of alias with alias template of
                    dependent template parameter containing lambda in
                    unevaluated context
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cooky.ykooc922 at gmail dot com
  Target Milestone: ---

Code:

/// test_alias
template <typename F>
using test_alias = decltype([]{ return F{}; }());

/// test_temp
template <typename F>
struct test_temp {
    using type = decltype([]{ return F{}; }());
};

struct Custom {};

/// test
template <typename F>
void test() {
    // does not produce error in 'test_alias<Custom>'
    using return_type = test_alias<F>;
    return_type result;

    // compiles fine with:
    // 'test_alias<F> result;'
}

Expected Behavior:
this should compile with no compilation error same as other compilers such as
Clang, and MSVC

Compilation Error Message:
<source>: In function 'void test()':
<source>:L:C: error: 'return_type' was not declared in this scope
   18 |     return_type result;

Other workaround (with no compilation error):

template <typename F>
void test0() {
    using return_type = test_temp<F>::type;
    return_type result;
}

GCC Version: 12 (trunk)
Additional Command Line: -std=c++20

Compiler Explorer Link: https://godbolt.org/z/TKWxfKjnY

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

* [Bug c++/105236] failed lookup of alias with alias template of dependent template parameter containing lambda in unevaluated context
  2022-04-12  6:01 [Bug c++/105236] New: failed lookup of alias with alias template of dependent template parameter containing lambda in unevaluated context cooky.ykooc922 at gmail dot com
@ 2022-04-12  7:59 ` jakub at gcc dot gnu.org
  2022-11-08 23:20 ` pinskia at gcc dot gnu.org
  2024-04-13  8:05 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-04-12  7:59 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-04-12
             Status|UNCONFIRMED                 |NEW
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |ppalka at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
This is rejected this way since
r9-4045-g0c1e0d63fe0ceabbd04384070f3b59f8bf50de09
when P0315R4 has been implemented (before it emitted more errors).

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

* [Bug c++/105236] failed lookup of alias with alias template of dependent template parameter containing lambda in unevaluated context
  2022-04-12  6:01 [Bug c++/105236] New: failed lookup of alias with alias template of dependent template parameter containing lambda in unevaluated context cooky.ykooc922 at gmail dot com
  2022-04-12  7:59 ` [Bug c++/105236] " jakub at gcc dot gnu.org
@ 2022-11-08 23:20 ` pinskia at gcc dot gnu.org
  2024-04-13  8:05 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-08 23:20 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |107430

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This might be a dup of another one of the lambda inside a decltype with an
alias issue. There are definitely many bugs have been filed with a similar
symptom.


Referenced Bugs:

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

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

* [Bug c++/105236] failed lookup of alias with alias template of dependent template parameter containing lambda in unevaluated context
  2022-04-12  6:01 [Bug c++/105236] New: failed lookup of alias with alias template of dependent template parameter containing lambda in unevaluated context cooky.ykooc922 at gmail dot com
  2022-04-12  7:59 ` [Bug c++/105236] " jakub at gcc dot gnu.org
  2022-11-08 23:20 ` pinskia at gcc dot gnu.org
@ 2024-04-13  8:05 ` 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:05 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 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] 4+ messages in thread

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-12  6:01 [Bug c++/105236] New: failed lookup of alias with alias template of dependent template parameter containing lambda in unevaluated context cooky.ykooc922 at gmail dot com
2022-04-12  7:59 ` [Bug c++/105236] " jakub at gcc dot gnu.org
2022-11-08 23:20 ` pinskia at gcc dot gnu.org
2024-04-13  8:05 ` 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).