<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 - Mangled name for std::is_same within function identifier changes when including <complex>"
   href="https://bugs.llvm.org/show_bug.cgi?id=34810">34810</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Mangled name for std::is_same within function identifier changes when including <complex>
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>5.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

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

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>yaghmour.shafik@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Given the following code:

#include <complex>
#include <type_traits>

template <typename T>
std::enable_if_t<std::is_same<T, float>::value, float> f(const void *g) 
{ return {}; }

template float f<float>(const void *g);

int main(){ return 0; }



and using the following command line options to clang++:

-stdlib=libc++ -std=c++14

The mangled name for the f(const void *g) drops std:: from std::is_same, we
get:

__Z1fIfENSt3__19enable_ifIXsr7is_sameIT_fEE5valueEfE4typeEPKv
                            ^^^

See gotbolt example: <a href="https://godbolt.org/g/RehUpq">https://godbolt.org/g/RehUpq</a>



while dropping dropping the include of <complex> we get: 

__Z1fIfENSt9enable_ifIXsr3std7is_sameIT_fEE5valueEfE4typeEPKv
                          ^^^^

See godbolt example: <a href="https://godbolt.org/g/CkEwJw">https://godbolt.org/g/CkEwJw</a>



In our larger application this is causing a linker failure. 

I don't believe this is expected behavior, we should expect the same type for
std::is_same<float,float> whether we include <complex> or not</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>