<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 - gsl::Owner seems not to work on custom class"
   href="https://bugs.llvm.org/show_bug.cgi?id=51967">51967</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>gsl::Owner seems not to work on custom class
          </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>Windows NT
          </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>C++
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>tiagomacarios@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Looking at <a href="https://reviews.llvm.org/D64448">https://reviews.llvm.org/D64448</a> I was expecting a warning on both
lines inside of fun(), but I only get the warning with unique_ptr. Is this a
bug or am I not understanding who this should be used?

<a href="https://godbolt.org/z/571sYxad3">https://godbolt.org/z/571sYxad3</a>

#include <memory>

template <typename T>
struct [[gsl::Owner]] my_unique_ptr
{
    T* m_p;
    T* get() const { return m_p; };
};

std::unique_ptr<int> get_unique_ptr();
my_unique_ptr<int> get_my_unique_ptr();

void fun()
{
    int* p1 = get_my_unique_ptr().get(); // no -Wdangling-gsl
    int* p2 = get_unique_ptr().get(); // -Wdangling-gsl
}</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>