<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 - Unavailable function incorrectly marked as deleted from within a scoped marked as unavailable"
   href="https://bugs.llvm.org/show_bug.cgi?id=40995">40995</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Unavailable function incorrectly marked as deleted from within a scoped marked as unavailable
          </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>All
          </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>Frontend
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>ldionne@apple.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Functions marked as unavailable appear as being deleted even when from a scope
that is unavailable too:

    $ cat <<EOF | clang++ -xc++ - -fsyntax-only -std=c++11
    #include <type_traits>

    #define UNAVAILABLE
__attribute__((availability(macosx,strict,introduced=99.99)))

    struct Bar { UNAVAILABLE Bar(int, int) { } };

    struct UNAVAILABLE Foo { 
        // this is performed in a scope marked as unavailable
        static_assert(std::is_constructible<Bar, int, int>::value, ""); // this
fires
    };
    EOF

I think the static_assert fires because the code is equivalent to marking
`Bar(int,int) = delete`, which would then fail the static_assert. However,
since `Bar(int, int)` is used (in std::is_constructible) from a context that is
transitively unavailable (because Foo is unavailable), I would expect `Bar(int,
int)` not to be marked deleted in that context.</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>