summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp')
-rw-r--r--contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp27
1 files changed, 10 insertions, 17 deletions
diff --git a/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp b/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp
index 568896d..e347d4e 100644
--- a/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp
+++ b/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp
@@ -543,10 +543,11 @@ Decl *Parser::ParseUsingDeclaration(unsigned Context,
SourceLocation IdLoc = ConsumeToken();
ParsedType Type = Actions.getInheritingConstructorName(SS, IdLoc, *LastII);
Name.setConstructorName(Type, IdLoc, IdLoc);
- } else if (ParseUnqualifiedId(SS, /*EnteringContext=*/ false,
- /*AllowDestructorName=*/ true,
- /*AllowConstructorName=*/ true, ParsedType(),
- TemplateKWLoc, Name)) {
+ } else if (ParseUnqualifiedId(
+ SS, /*EnteringContext=*/false,
+ /*AllowDestructorName=*/true,
+ /*AllowConstructorName=*/NextToken().isNot(tok::equal),
+ ParsedType(), TemplateKWLoc, Name)) {
SkipUntil(tok::semi);
return nullptr;
}
@@ -2814,16 +2815,10 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
break;
}
- if ((S->getFlags() & Scope::FnScope)) {
- // If we're in a function or function template declared in the
- // body of a class, then this is a local class rather than a
- // nested class.
- const Scope *Parent = S->getParent();
- if (Parent->isTemplateParamScope())
- Parent = Parent->getParent();
- if (Parent->isClassScope())
- break;
- }
+ if ((S->getFlags() & Scope::FnScope))
+ // If we're in a function or function template then this is a local
+ // class rather than a nested class.
+ break;
}
}
@@ -3813,7 +3808,7 @@ SourceLocation Parser::SkipCXX11Attributes() {
return EndLoc;
}
-/// Parse one or more Microsoft-style attributes [Attr]
+/// ParseMicrosoftAttributes - Parse Microsoft attributes [Attr]
///
/// [MS] ms-attribute:
/// '[' token-seq ']'
@@ -3829,8 +3824,6 @@ void Parser::ParseMicrosoftAttributes(ParsedAttributes &attrs,
// FIXME: If this is actually a C++11 attribute, parse it as one.
BalancedDelimiterTracker T(*this, tok::l_square);
T.consumeOpen();
- if (Tok.is(tok::r_square))
- Diag(T.getOpenLocation(), diag::err_empty_attribute_block);
SkipUntil(tok::r_square, StopAtSemi | StopBeforeMatch);
T.consumeClose();
if (endLoc)
OpenPOWER on IntegriCloud