<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 - invalid DW_AT_linkage_name generated for cos<int>"
   href="https://bugs.llvm.org/show_bug.cgi?id=43491">43491</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>invalid DW_AT_linkage_name generated for cos<int>
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>8.0
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Linux
          </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>C++
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>mail@milianw.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=22597" name="attach_22597" title="source code to reproduce issue, compile with `clang++ -O2 -g -static`">attachment 22597</a> <a href="attachment.cgi?id=22597&action=edit" title="source code to reproduce issue, compile with `clang++ -O2 -g -static`">[details]</a></span>
source code to reproduce issue, compile with `clang++ -O2 -g -static`

take the attached code and compile it with `clang++ -O2 -g -static` then look
at the DWARF data e.g. with dwarfdump or similar. You'll notice this:

```
< 2><0x00001b6e>      DW_TAG_subprogram
                        DW_AT_linkage_name         
_ZSt3cosIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_
                        DW_AT_name                  cos<int>
                        DW_AT_decl_file             0x00000015
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0/cmath
                        DW_AT_decl_line             0x000000c4
                        DW_AT_type                  <0x000026b1>
                        DW_AT_external              yes(1)
                        DW_AT_inline                DW_INL_inlined
```

Now let's use the DW_AT_linkage_name with c++filt or cxxabi's demangle function
and nothing will happen:

```
c++filt
_ZSt3cosIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_
_ZSt3cosIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_
```

Apparently this isn't a valid mangled name? I don't have enough knowledge of
the format to say why it's not properly demangled, I can only report that it
doesn't work as expected...</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>