<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 - Availability attribute incorrectly triggers when during instantiation of template from an unavailable context"
   href="https://bugs.llvm.org/show_bug.cgi?id=41078">41078</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Availability attribute incorrectly triggers when during instantiation of template from an unavailable context
          </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>The following program produces an error saying that 'A' is unavailable:

    $ cat <<EOF | clang++ -xc++ -std=c++2a - -fsyntax-only
    template <class T>
    struct Inherit : private T {
       Inherit() = default;
    };

    #pragma clang attribute
push(__attribute__((availability(macosx,strict,unavailable))),
apply_to=any(function,record))
    struct A { A() { } };
    struct B { B() { Inherit<A> xx; } };
    #pragma clang attribute pop
    EOF

The error is (after applying <a href="https://reviews.llvm.org/D59394">https://reviews.llvm.org/D59394</a>):

    <stdin>:3:4: error: 'A' is unavailable: not available on macOS
       Inherit() = default;
       ^
    <stdin>:8:29: note: in implicit default constructor for 'Inherit<A>' first
required here
    struct B { B() { Inherit<A> xx; } };
                                ^
    <stdin>:7:12: note: 'A' has been explicitly marked unavailable here
    struct A { A() { } };
               ^

Basically, it looks as though we don't see that `Inherit<A>` is being
instantiated from an unavailable context, and so that we shouldn't trigger an
availability error for using `A`.</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>