<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 - Undefined symbols when using boost statecharts"
   href="https://bugs.llvm.org/show_bug.cgi?id=43352">43352</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Undefined symbols when using boost statecharts
          </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>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>COFF
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>brian.j.cody@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Version 9.0.0 RC5

The same link works in ld. You can use the boost statechart as such:

namespace my_namespace
{
struct evt_done_state: boost::statechart::event<evt_done_state> {};
}

lld-link: error: undefined symbol:
__ZN5boost10statechart6detail10no_contextIN12my_namespace14evt_done_stateEE11no_funct>>>
referenced by (... file path)


Looking at the boost source code, there is declared, undefined function. This
was taken from boost 1.63.0, but the specific code is common for older and
newer versions:
boost\statechart\detail\reaction_dispatcher.hpp:33
template< class Event >
struct no_context
{
  void no_function( const Event & ); // <------
};

The method is not called or referenced, and shows up as 'U' in nm. I suspect ld
drops the unused, undefined symbol.

We're working around this by changing the offending line to:
void no_function( const Event & ) {}</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>