diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-04-14 17:21:19 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-04-14 17:21:19 +0000 |
commit | 8a9013d24864272cf5b18c908a267bd7a2bda4c4 (patch) | |
tree | 0fe60f73c5c6a17b1da18361987b115109977f0b /lib/Parse/ParseDeclCXX.cpp | |
parent | 5bbcdbf36f8cf79d99703ef20848c55960065e43 (diff) |
Parse an '@' in an Objective-C++ class member specification,
diagnosing it as an error rather than looping infinitely. Also,
explicitly disallow @defs in Objective-C++. Fixes <rdar://problem/9260136>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129521 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDeclCXX.cpp')
-rw-r--r-- | lib/Parse/ParseDeclCXX.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index dac40d8713..9c0730dce9 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/lib/Parse/ParseDeclCXX.cpp @@ -1374,6 +1374,17 @@ bool Parser::isCXX0XFinalKeyword() const { void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS, const ParsedTemplateInfo &TemplateInfo, ParsingDeclRAIIObject *TemplateDiags) { + if (Tok.is(tok::at)) { + if (getLang().ObjC1 && NextToken().isObjCAtKeyword(tok::objc_defs)) + Diag(Tok, diag::err_at_defs_cxx); + else + Diag(Tok, diag::err_at_in_class); + + ConsumeToken(); + SkipUntil(tok::r_brace); + return; + } + // Access declarations. if (!TemplateInfo.Kind && (Tok.is(tok::identifier) || Tok.is(tok::coloncolon)) && |