<html>
    <head>
      <base href="http://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 --- - Simple sample is broken after r217874: assert(use_empty() && "Uses remain when a value is destroyed!") in Value.cpp is fired"
   href="http://llvm.org/bugs/show_bug.cgi?id=21043">21043</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Simple sample is broken after r217874: assert(use_empty() && "Uses remain when a value is destroyed!") in Value.cpp is fired
          </td>
        </tr>

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

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

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

        <tr>
          <th>Component</th>
          <td>LLVM Codegen
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>zinovy.nis@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Commit <a href="http://llvm.org/viewvc/llvm-project?view=revision&revision=217874">http://llvm.org/viewvc/llvm-project?view=revision&revision=217874</a> make
clang fail on the following sample:

------------------- inc.h ---------------
#pragma once

template <typename FP> struct Struct
{
        Struct() {}
        ~Struct(){}
};

--------- def.cpp -----------------------
#include "inc.h"

template struct Struct<float>;

--------- main.cpp -----------------------
#include "inc.h"

int main(int argc, char *argv[])
{
    Struct<float> dummy;
    return 0;
}


Compile it with: 

./clang++ -O0 -march=core-avx2 -flto -DNDEBUG main.cpp def.cpp


Compiler crahses with: 

While deleting: %struct.Struct.0* %this
Use still stuck around after Def is destroyed:%struct.Struct.0* %this
ld: ~/TRUNK/llvm.vect.clear/llvm/lib/IR/Value.cpp:80: virtual
llvm::Value::~Value(): Assertion `use_empty() && "Uses remain when a value is
destroyed!"' failed.
clang-3.5: error: unable to execute command: Aborted
clang-3.5: error: linker command failed due to signal (use -v to see
invocation)</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>