Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions clang/lib/Parse/ParseDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6813,10 +6813,10 @@ void Parser::ParseDirectDeclarator(Declarator &D) {
bool IsFunctionDeclaration = D.isFunctionDeclaratorAFunctionDeclaration();
// Enter function-declaration scope, limiting any declarators to the
// function prototype scope, including parameter declarators.
ParseScope PrototypeScope(this,
Scope::FunctionPrototypeScope|Scope::DeclScope|
(IsFunctionDeclaration
? Scope::FunctionDeclarationScope : 0));
ParseScope PrototypeScope(
this, Scope::FunctionPrototypeScope | Scope::DeclScope |
(IsFunctionDeclaration ? Scope::FunctionDeclarationScope
: Scope::NoScope));

// The paren may be part of a C++ direct initializer, eg. "int x(1);".
// In such a case, check if we actually have a function declarator; if it
Expand Down Expand Up @@ -7097,8 +7097,9 @@ void Parser::ParseParenDeclarator(Declarator &D) {
// function prototype scope, including parameter declarators.
ParseScope PrototypeScope(this,
Scope::FunctionPrototypeScope | Scope::DeclScope |
(D.isFunctionDeclaratorAFunctionDeclaration()
? Scope::FunctionDeclarationScope : 0));
(D.isFunctionDeclaratorAFunctionDeclaration()
? Scope::FunctionDeclarationScope
: Scope::NoScope));
ParseFunctionDeclarator(D, attrs, T, false, RequiresArg);
PrototypeScope.Exit();
}
Expand Down
6 changes: 3 additions & 3 deletions clang/lib/Parse/ParseObjc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3295,9 +3295,9 @@ void Parser::ParseLexedObjCMethodDefs(LexedMethod &LM, bool parseMethod) {
assert(Tok.isOneOf(tok::l_brace, tok::kw_try, tok::colon) &&
"Inline objective-c method not starting with '{' or 'try' or ':'");
// Enter a scope for the method or c-function body.
ParseScope BodyScope(this, (parseMethod ? Scope::ObjCMethodScope : 0) |
Scope::FnScope | Scope::DeclScope |
Scope::CompoundStmtScope);
ParseScope BodyScope(
this, (parseMethod ? Scope::ObjCMethodScope : Scope::NoScope) |
Scope::FnScope | Scope::DeclScope | Scope::CompoundStmtScope);
Sema::FPFeaturesStateRAII SaveFPFeatures(Actions);

// Tell the actions module that we have entered a method or c-function definition
Expand Down
12 changes: 6 additions & 6 deletions clang/lib/Parse/ParseStmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2529,9 +2529,9 @@ StmtResult Parser::ParseCXXTryBlockCommon(SourceLocation TryLoc, bool FnTry) {
return StmtError(Diag(Tok, diag::err_expected) << tok::l_brace);

StmtResult TryBlock(ParseCompoundStatement(
/*isStmtExpr=*/false, Scope::DeclScope | Scope::TryScope |
Scope::CompoundStmtScope |
(FnTry ? Scope::FnTryCatchScope : 0)));
/*isStmtExpr=*/false,
Scope::DeclScope | Scope::TryScope | Scope::CompoundStmtScope |
(FnTry ? Scope::FnTryCatchScope : Scope::NoScope)));
if (TryBlock.isInvalid())
return TryBlock;

Expand Down Expand Up @@ -2593,9 +2593,9 @@ StmtResult Parser::ParseCXXCatchBlock(bool FnCatch) {
// C++ 3.3.2p3:
// The name in a catch exception-declaration is local to the handler and
// shall not be redeclared in the outermost block of the handler.
ParseScope CatchScope(this, Scope::DeclScope | Scope::ControlScope |
Scope::CatchScope |
(FnCatch ? Scope::FnTryCatchScope : 0));
ParseScope CatchScope(
this, Scope::DeclScope | Scope::ControlScope | Scope::CatchScope |
(FnCatch ? Scope::FnTryCatchScope : Scope::NoScope));

// exception-declaration is equivalent to '...' or a parameter-declaration
// without default arguments.
Expand Down
Loading