<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 - Link error with make_shared and scoped constant expression"
   href="https://bugs.llvm.org/show_bug.cgi?id=33090">33090</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Link error with make_shared and scoped constant expression
          </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>Linux
          </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>marcosatti@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=18465" name="attach_18465" title="Failing source code">attachment 18465</a> <a href="attachment.cgi?id=18465&action=edit" title="Failing source code">[details]</a></span>
Failing source code

Source code attached fails at the linking stage.
>From the output, I can see it is calling make_shared using a reference, not a
constant. Of course, the constexpr is taken out at compile time, and so fails
with undefined reference.

marco@Marco-Laptop-PC:/mnt/c/Shared/Dev/Projects/clangbug$ clang++-5.0
--version
clang version 5.0.0-svn303316-1~exp1 (trunk)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

marco@Marco-Laptop-PC:/mnt/c/Shared/Dev/Projects/clangbug$ clang++-5.0
-std=c++14 main.cpp -o main
/tmp/main-1722a6.o: In function `main':
main.cpp:(.text+0x17): undefined reference to `test::sz'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
marco@Marco-Laptop-PC:/mnt/c/Shared/Dev/Projects/clangbug$

However, using -std=c++1z, the code compiles fine. Sorry if this is not a
linker bug but a clang bug.

It could also be a GCC bug, which I have used to compare against. Using
-std=c++14 works under GCC. (Sorry if it is!)

If it matters, I am running Ubuntu 16.04 under the Windows subsystem for Linux.

Thanks, Marco.</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>