[cfe-commits] r69980 - in /cfe/trunk: lib/Sema/SemaExpr.cpp test/SemaObjC/sizeof-interface.m
Eli Friedman
eli.friedman at gmail.com
Fri Apr 24 11:35:30 PDT 2009
On Fri, Apr 24, 2009 at 10:35 AM, Fariborz Jahanian <fjahanian at apple.com> wrote:
> // Reject sizeof(interface) and sizeof(interface<proto>) in 64-bit mode.
> - if (exprType->isObjCInterfaceType() && LangOpts.ObjCNonFragileABI) {
> + if (LangOpts.ObjCNonFragileABI && exprType->isObjCInterfaceType()) {
> Diag(OpLoc, diag::err_sizeof_nonfragile_interface)
> << exprType << isSizeof;
> - return true;
> + return false;
> }
This patch looks wrong; this should definitely be returning true.
Otherwise, it looks like a valid declaration.
> + @public
> + unsigned long attributeRuns[1024 + sizeof(I)]; // expected-error {{invalid application of 'sizeof' to interface 'I' in non-fragile ABI}}
Specifically, have you considered what happens when someone tries to
compute sizeof(attributeRuns)?
-Eli
More information about the cfe-commits
mailing list