public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/100825] New: function signature constraints are not a part of mangled name
@ 2021-05-29 11:54 vopl at bk dot ru
  2021-05-29 12:22 ` [Bug c++/100825] " vopl at bk dot ru
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: vopl at bk dot ru @ 2021-05-29 11:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100825
           Summary: function signature constraints are not a part of
                    mangled name
           Product: gcc
           Version: 11.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vopl at bk dot ru
  Target Milestone: ---

$ cat b.cpp && echo EOFFFFFF

template <class T> void foo() // 1
{}

template <class T> void foo() requires (sizeof(char) == sizeof(T)) // 2
{
    foo<int>();// call 1 - instantiate "void foo<int>()"
}

template <class T> void foo() requires (sizeof(int) == sizeof(T)) // 3
{}

void use()
{
    foo<char>(); // call 2
    foo<int>(); // call 3 - instantiate "void foo<int>() requires (sizeof(int)
== sizeof(T))"
}

// so, two different function instantiated with same mangled name

EOFFFFFF

$ g++ -std=c++20 -v -c b.cpp 
Using built-in specs.
COLLECT_GCC=g++
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-10.2.0-r5/work/gcc-10.2.0/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/10.2.0
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/10.2.0
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/10.2.0/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/10.2.0/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include/g++-v10
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/10.2.0/python
--enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --disable-nls --enable-checking=release
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 10.2.0-r5 p6'
--disable-esp --enable-libstdcxx-time --with-build-config=bootstrap-lto
--enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64
--disable-fixed-point --enable-targets=all --enable-libgomp --disable-libssp
--disable-libada --enable-systemtap --enable-vtable-verify --with-zstd
--enable-lto --with-isl --disable-isl-version-check --enable-default-pie
--disable-default-ssp
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.0 (Gentoo 10.2.0-r5 p6) 
COLLECT_GCC_OPTIONS='-std=c++2a' '-v' '-c' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
 /usr/libexec/gcc/x86_64-pc-linux-gnu/10.2.0/cc1plus -quiet -v -D_GNU_SOURCE
b.cpp -quiet -dumpbase b.cpp -mtune=generic -march=x86-64 -auxbase b -std=c++2a
-version -o /tmp/ccdHBZw0.s
GNU C++17 (Gentoo 10.2.0-r5 p6) version 10.2.0 (x86_64-pc-linux-gnu)
        compiled by GNU C version 10.2.0, GMP version 6.2.1, MPFR version
4.1.0, MPC version 1.2.1, isl version isl-0.23-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include/g++-v10
 /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include/g++-v10/x86_64-pc-linux-gnu
 /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include/g++-v10/backward
 /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include
 /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include-fixed
 /usr/include
End of search list.
GNU C++17 (Gentoo 10.2.0-r5 p6) version 10.2.0 (x86_64-pc-linux-gnu)
        compiled by GNU C version 10.2.0, GMP version 6.2.1, MPFR version
4.1.0, MPC version 1.2.1, isl version isl-0.23-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 109a96b688365221cca69113b161e683
COLLECT_GCC_OPTIONS='-std=c++2a' '-v' '-c' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
 /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/as
-v --64 -o b.o /tmp/ccdHBZw0.s
GNU assembler version 2.35.2 (x86_64-pc-linux-gnu) using BFD version (Gentoo
2.35.2 p1) 2.35.2
/tmp/ccdHBZw0.s: Assembler messages:
/tmp/ccdHBZw0.s:61: Error: symbol `_Z3fooIiEvv' is already defined



---------------
My expectations: mangled names must be different, because mangled name is based
on the signature and a signature includes the requires-clause as a part

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

end of thread, other threads:[~2023-10-06  2:02 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-29 11:54 [Bug c++/100825] New: function signature constraints are not a part of mangled name vopl at bk dot ru
2021-05-29 12:22 ` [Bug c++/100825] " vopl at bk dot ru
2021-05-31 11:08 ` vopl at bk dot ru
2021-06-01  9:47 ` redi at gcc dot gnu.org
2021-06-01 10:44 ` vopl at bk dot ru
2021-06-01 11:30 ` redi at gcc dot gnu.org
2021-06-01 13:41 ` vopl at bk dot ru
2021-06-02 16:26 ` rs2740 at gmail dot com
2021-06-09 16:56 ` nickolay.merkin at gmail dot com
2021-06-09 17:25 ` redi at gcc dot gnu.org
2021-08-02  9:02 ` redi at gcc dot gnu.org
2021-08-02  9:29 ` redi at gcc dot gnu.org
2022-05-04 20:39 ` redi at gcc dot gnu.org
2023-01-06  6:35 ` pinskia at gcc dot gnu.org
2023-04-07 19:50 ` richard-gccbugzilla at metafoo dot co.uk
2023-10-06  2:02 ` 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).