<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:nicolasweber@gmx.de" title="Nico Weber <nicolasweber@gmx.de>"> <span class="fn">Nico Weber</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WONTFIX - llvm-undname sometimes drops a "const""
   href="https://bugs.llvm.org/show_bug.cgi?id=39630">bug 39630</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>WONTFIX
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WONTFIX - llvm-undname sometimes drops a "const""
   href="https://bugs.llvm.org/show_bug.cgi?id=39630#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WONTFIX - llvm-undname sometimes drops a "const""
   href="https://bugs.llvm.org/show_bug.cgi?id=39630">bug 39630</a>
              from <span class="vcard"><a class="email" href="mailto:nicolasweber@gmx.de" title="Nico Weber <nicolasweber@gmx.de>"> <span class="fn">Nico Weber</span></a>
</span></b>
        <pre>I'm willing to believe it's an undname bug :-) The wine implementation of
_unDName has it too fwiw.

I tried finding the test case you mention but failed.

...aha, but here's a from-source repro that shows you're right:

$ cat test.cc
struct S {};

struct T {
  static const S* s_;

  const S* s();
  void set(const S* s);
};

const S* T::s() { return s_; }
void T::set(const S* s) { s_ = s; }


$ third_party/llvm-build/Release+Asserts/bin/clang-cl /c test.cc /Fa -Xclang
-emit-llvm 2&>1 > /dev/null ; cat test.asm | grep s_
@"?s_@T@@2PEBUS@@EB" = external dso_local global %struct.S*, align 8
  %0 = load %struct.S*, %struct.S** @"?s_@T@@2PEBUS@@EB", align 8
  store %struct.S* %0, %struct.S** @"?s_@T@@2PEBUS@@EB", align 8


$ demumble '?s_@T@@2PEBUS@@EB'  # currently uses wine _unDName()
public: static struct S const * __ptr64 const __ptr64 T::s_


$ bin/llvm-undname '?s_@T@@2PEBUS@@EB'
?s_@T@@2PEBUS@@EB
public: static struct S const *T::s_</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>