<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 - Demangled name of dynamic initializer in PDB doesn't match demangled name produced by MSVC"
   href="https://bugs.llvm.org/show_bug.cgi?id=51384">51384</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Demangled name of dynamic initializer in PDB doesn't match demangled name produced by MSVC
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lld
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </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>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>stefan.reinalter@molecular-matters.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, smithp352@googlemail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When compiling the following code, the compiler will emit a dynamic initializer
into the executable:

class CompilerSegmentTest
{
public:
  CompilerSegmentTest(void)
  {
    printf("CompilerSegmentTest CTR called\n");
  }

  ~CompilerSegmentTest(void)
  {
    printf("CompilerSegmentTest DTR called\n");
  }
};

namespace customNamespace
{
#pragma warning (disable:4074)
#pragma init_seg(compiler)

static CompilerSegmentTest g_compilerSegmentTestInstance;

#pragma warning (default:4074)
}


In the .obj file, this symbol is named
??__Eg_compilerSegmentTestInstance@customNamespace@@YAXXZ.

In the PDB file, this symbol will appear with its demangled name only, because
it is private and not contained in the public symbol stream.

When using MSVC, the demangled name in the PDB will be:
customNamespace::`dynamic initializer for 'g_compilerSegmentTestInstance''

When using lld, the demangled name in the PDB is slightly different however:
customNamespace::`dynamic initializer for 'g_compilerSegmentTestInstance'
(note the last missing ')

I've noticed this with a few symbols, and it seems that lld (or clang?) doesn't
like to emit two consecutive '' in demangled names.</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>