<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - missing comdats for static initializers in template and guard variables"
   href="https://llvm.org/bugs/show_bug.cgi?id=23472">23472</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>missing comdats for static initializers in template and guard variables
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </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>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>yaron.keren@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dschuff@google.com, geek4civic@gmail.com, llvmbugs@cs.uiuc.edu, rnk@google.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=14307" name="attach_14307" title="header">attachment 14307</a> <a href="attachment.cgi?id=14307&action=edit" title="header">[details]</a></span>
header

compiling the attached sources on Windows x64 using

 clang++ l1.cpp l2.cpp -target i686-pc-windows-gnu

results in

 multiple definition of `guard variable for
lanczos_initializer<int>::initializer'

where as g++ is ok:

 g++ l1.cpp l2.cpp

the object files shows comdats with g++ but not with clang:

 >g++ l1.cpp -c & nm l1.o
00000000 b .bss
00000000 d .ctors
00000000 d .data
00000000 d .data$_ZGVN19lanczos_initializerIiE11initializerE
00000000 d .data$_ZN19lanczos_initializerIiE11initializerE
00000000 r .eh_frame
00000000 r .eh_frame$_ZN4initC1Ev
00000000 r .rdata$zzz
00000000 t .text
00000000 t .text$_ZN4initC1Ev
00000037 t __GLOBAL__sub_I__Z2l1v
00000000 T __Z2l1v
00000005 t __Z41__static_initialization_and_destruction_0ii
00000000 D __ZGVN19lanczos_initializerIiE11initializerE
00000000 D __ZN19lanczos_initializerIiE11initializerE
00000000 T __ZN4initC1Ev


 >clang++ l1.cpp -c -target i686-pc-windows-gnu & nm l1.o
00000000 b .bss
00000000 b .bss
00000000 b .bss
00000000 d .ctors
00000000 d .data
00000000 d .eh_frame
00000000 t .text
00000000 t .text
00000000 t .text
00000001 a @feat.00
00000000 t ___cxx_global_var_init
00000000 T __Z2l1v
00000000 B __ZGVN19lanczos_initializerIiE11initializerE
00000000 B __ZN19lanczos_initializerIiE11initializerE
00000000 T __ZN4initC2Ev</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>