[llvm-bugs] [Bug 50540] New: function signature constraints are not a part of mangled name

via llvm-bugs llvm-bugs at lists.llvm.org
Mon May 31 04:02:59 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=50540

            Bug ID: 50540
           Summary: function signature constraints are not a part of
                    mangled name
           Product: clang
           Version: 11.0
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: vopl at bk.ru
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

$ cat b.cpp && echo EOFFFFFFFFFF
template <class> void foo() {} //1
void useFirst()
{
    foo<void>();// call 1 - instantiate "void foo<int>()"
}

template <class> void foo() requires true {} //2
void useSecond()
{
    foo<void>();// call 2 - instantiate "void foo<int>() requires true"
}
EOFFFFFFFFFF

$ clang++ -v -std=c++20 -c b.cpp
clang version 11.1.0
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/11/bin
Selected GCC installation: /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
 (in-process)
 "/usr/lib/llvm/11/bin/clang-11" -cc1 -triple x86_64-pc-linux-gnu -emit-obj
-mrelax-all -disable-free -disable-llvm-verifier -discard-value-names
-main-file-name b.cpp -mrelocation-model static -mframe-pointer=all
-fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables
-target-cpu x86-64 -fno-split-dwarf-inlining -debugger-tuning=gdb -v
-resource-dir /usr/lib/llvm/11/bin/../../../../lib/clang/11.1.0
-internal-isystem /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include/g++-v10
-internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include/g++-v10/x86_64-pc-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include/g++-v10/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/lib/llvm/11/bin/../../../../lib/clang/11.1.0/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-std=c++20 -fdeprecated-macro -fdebug-compilation-dir /home/vopl/tmp/15
-ferror-limit 19 -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions
-fcolor-diagnostics -o b.o -x c++ b.cpp
clang -cc1 version 11.1.0 based upon LLVM 11.1.0 default target
x86_64-pc-linux-gnu
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/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/llvm/11/bin/../../../../lib/clang/11.1.0/include
 /usr/include
End of search list.
b.cpp:7:23: error: definition with same mangled name '_Z3fooIvEvv' as another
definition
template <class> void foo() requires true {} //2
                      ^
b.cpp:1:23: note: previous definition is here
template <class> void foo() {} //1
                      ^
1 error generated.

---------------
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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210531/4002d9ef/attachment.html>


More information about the llvm-bugs mailing list