http://llvm.org/bugs/show_bug.cgi?id=21128

            Bug ID: 21128
           Summary: Allow a pseudo-destructor call on a pointer to a
                    forward declared ObjC class
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

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."

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to