public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/109422] New: wrong depth used for template parameter mangling for lambdas in function signatures
@ 2023-04-05 17:36 richard-gccbugzilla at metafoo dot co.uk
  2023-04-05 17:39 ` [Bug c++/109422] " richard-gccbugzilla at metafoo dot co.uk
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: richard-gccbugzilla at metafoo dot co.uk @ 2023-04-05 17:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109422
           Summary: wrong depth used for template parameter mangling for
                    lambdas in function signatures
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: richard-gccbugzilla at metafoo dot co.uk
  Target Milestone: ---

Testcase:

struct C {
  template<typename T>
  void f(decltype([](T, auto) { return 0; })) {}  
};
void g() { C().f<int>({}); }

GCC mangles f<int> as _ZN1C1fIiEEvDTtlNS_UlT_T_E_EEE -- note that this is
mangling / numbering the lambda directly within C, which is not permitted by
http://itanium-cxx-abi.github.io/cxx-abi/abi.html#closure-types but seems like
the best choice (see https://github.com/itanium-cxx-abi/cxx-abi/issues/165).

But the mangling of the <lambda-sig> as T_T_ is definitely wrong -- two
different template parameters should not be mangled the same. This should
instead be mangled as T_TL__ under
https://github.com/itanium-cxx-abi/cxx-abi/issues/31#issuecomment-528122117

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

* [Bug c++/109422] wrong depth used for template parameter mangling for lambdas in function signatures
  2023-04-05 17:36 [Bug c++/109422] New: wrong depth used for template parameter mangling for lambdas in function signatures richard-gccbugzilla at metafoo dot co.uk
@ 2023-04-05 17:39 ` richard-gccbugzilla at metafoo dot co.uk
  2023-10-10 21:23 ` cvs-commit at gcc dot gnu.org
  2023-11-17  2:42 ` jason at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: richard-gccbugzilla at metafoo dot co.uk @ 2023-04-05 17:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Richard Smith <richard-gccbugzilla at metafoo dot co.uk> ---
> This should instead be mangled as T_TL__

Sorry, that's wrong; the rule we ended up with would mangle this as T_TL0__.

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

* [Bug c++/109422] wrong depth used for template parameter mangling for lambdas in function signatures
  2023-04-05 17:36 [Bug c++/109422] New: wrong depth used for template parameter mangling for lambdas in function signatures richard-gccbugzilla at metafoo dot co.uk
  2023-04-05 17:39 ` [Bug c++/109422] " richard-gccbugzilla at metafoo dot co.uk
@ 2023-10-10 21:23 ` cvs-commit at gcc dot gnu.org
  2023-11-17  2:42 ` jason at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-10-10 21:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

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

commit r14-4544-gbd5719bd7f7cb23e5ed96a1f1a28efbb3dec4a31
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Oct 6 11:41:20 2023 -0400

    c++: mangle multiple levels of template parms [PR109422]

    This becomes be more important with concepts, but can also be seen with
    generic lambdas.

            PR c++/109422

    gcc/cp/ChangeLog:

            * mangle.cc (write_template_param): Also mangle level.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/lambda-generic-mangle1.C: New test.
            * g++.dg/cpp2a/lambda-generic-mangle1a.C: New test.

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

* [Bug c++/109422] wrong depth used for template parameter mangling for lambdas in function signatures
  2023-04-05 17:36 [Bug c++/109422] New: wrong depth used for template parameter mangling for lambdas in function signatures richard-gccbugzilla at metafoo dot co.uk
  2023-04-05 17:39 ` [Bug c++/109422] " richard-gccbugzilla at metafoo dot co.uk
  2023-10-10 21:23 ` cvs-commit at gcc dot gnu.org
@ 2023-11-17  2:42 ` jason at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jason at gcc dot gnu.org @ 2023-11-17  2:42 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |jason at gcc dot gnu.org

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for GCC 14.

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

end of thread, other threads:[~2023-11-17  2:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-05 17:36 [Bug c++/109422] New: wrong depth used for template parameter mangling for lambdas in function signatures richard-gccbugzilla at metafoo dot co.uk
2023-04-05 17:39 ` [Bug c++/109422] " richard-gccbugzilla at metafoo dot co.uk
2023-10-10 21:23 ` cvs-commit at gcc dot gnu.org
2023-11-17  2:42 ` jason 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).