<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - function signature constraints are not a part of mangled name"
   href="https://bugs.llvm.org/show_bug.cgi?id=50540">50540</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>function signature constraints are not a part of mangled name
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>11.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++2a
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>vopl@bk.ru
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>$ 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</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>