forked from OSchip/llvm-project
parent
d0257f79bc
commit
786e04cda5
|
@ -1244,7 +1244,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
|
|||
DiagID, getLang());
|
||||
break;
|
||||
case tok::kw_auto:
|
||||
if (getLang().CPlusPlus0x)
|
||||
if (getLang().CPlusPlus0x || getLang().ObjC1)
|
||||
isInvalid = DS.SetTypeSpecType(DeclSpec::TST_auto, Loc, PrevSpec,
|
||||
DiagID);
|
||||
else
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
// RUN: %clang_cc1 -x objective-c -fblocks -fsyntax-only -verify %s
|
||||
|
||||
@interface I
|
||||
{
|
||||
id pi;
|
||||
}
|
||||
- (id) Meth;
|
||||
@end
|
||||
|
||||
|
||||
typedef int (^P) (int x);
|
||||
|
||||
@implementation I
|
||||
- (id) Meth {
|
||||
auto p = [pi Meth];
|
||||
return p;
|
||||
}
|
||||
|
||||
- (P) bfunc {
|
||||
auto my_block = ^int (int x) {return x; };
|
||||
my_block(1);
|
||||
return my_block;
|
||||
}
|
||||
@end
|
Loading…
Reference in New Issue