<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </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 --- - Allow a pseudo-destructor call on a pointer to a forward declared ObjC class"
   href="http://llvm.org/bugs/show_bug.cgi?id=21128">21128</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Allow a pseudo-destructor call on a pointer to a forward declared ObjC class
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>normal
          </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>akyrtzi@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The following snippet triggers a compiler error for the ObjC class pointer:
 error: member access into incomplete type 'ObjCForwardClass'

class CXXForwardClass;
@class ObjCForwardClass;

template <typename T>
void destroy () { T u; u.~T(); }

int main () {
    destroy<CXXForwardClass*>();
    destroy<ObjCForwardClass*>();
}


Per John McCall's comments:

"Pointers to forward-declared Objective-C classes are still complete types. 
They should be both destructible and (outside of ARC) non-trivially
destructible.

I assume the problem here is ObjC property syntax, which usually looks like
“foo.prop” where foo has ObjC pointer type.  Type-checking a property access
really does require the type to be complete.  However, pseudo-destructor calls
are not property accesses, and should not require the pointee type to be
complete.

We already accept the pseudo-destructor call if the interface type is complete,
presumably without actually looking anything up in the interface.  We just
unnecessarily bail out early if the interface is incomplete, despite it being a
pseudo-destructor call."</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>