* fixed support for forward-declared objcprotocols

+ test (also for warning about missing constructor)

git-svn-id: branches/objc@13633 -
This commit is contained in:
Jonas Maebe 2009-09-01 13:55:14 +00:00
parent f586299b6a
commit 970fc43aa5
3 changed files with 24 additions and 1 deletions

1
.gitattributes vendored
View File

@ -8221,6 +8221,7 @@ tests/test/tobjc10.pp svneol=native#text/plain
tests/test/tobjc11.pp svneol=native#text/plain
tests/test/tobjc12.pp svneol=native#text/plain
tests/test/tobjc13.pp svneol=native#text/plain
tests/test/tobjc14.pp svneol=native#text/plain
tests/test/tobjc2.pp svneol=native#text/plain
tests/test/tobjc3.pp svneol=native#text/plain
tests/test/tobjc4.pp svneol=native#text/plain

View File

@ -389,7 +389,8 @@ implementation
if ((token=_CLASS) or
(token=_INTERFACE) or
(token=_DISPINTERFACE) or
(token=_OBJCCLASS)) and
(token=_OBJCCLASS) or
(token=_OBJCPROTOCOL)) and
(assigned(ttypesym(sym).typedef)) and
is_class_or_interface_or_dispinterface_or_objc(ttypesym(sym).typedef) and
(oo_is_forward in tobjectdef(ttypesym(sym).typedef).objectoptions) then

21
tests/test/tobjc14.pp Normal file
View File

@ -0,0 +1,21 @@
{ %OPT=-Sew -vw }
{ %norun }
{$mode objfpc}
{$modeswitch objectivec1}
{ test forward-declared objcprotocol }
{ make sure no warning is given about the absense of any constructors }
type
ta = objcprotocol;
tb = objcclass
a: ta;
end; external name 'NSObject';
ta = objcprotocol
end; external name 'NSObject';
begin
end.