summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseCXXInlineMethods.cpp
diff options
context:
space:
mode:
authorMomchil Velikov <momchil.velikov@arm.com>2017-08-10 15:43:06 +0000
committerMomchil Velikov <momchil.velikov@arm.com>2017-08-10 15:43:06 +0000
commit57c681f33e56019ab92901e09d7bd26b0ccdffa5 (patch)
treed04a2d4992b1b8f97d8ac8aa0f7e07df124e5257 /clang/lib/Parse/ParseCXXInlineMethods.cpp
parentc717041e847db8bd7dfee61ee2a00c3653704651 (diff)
downloadbcm5719-llvm-57c681f33e56019ab92901e09d7bd26b0ccdffa5.tar.gz
bcm5719-llvm-57c681f33e56019ab92901e09d7bd26b0ccdffa5.zip
Place implictly declared functions at block scope
Such implicitly declared functions behave as if the enclosing block contained the declaration extern int name() (C90, 6.3.3.2 Function calls), thus their names should have block scope (C90, 6.1.2.1 Scope of identifiers). This patch fixes https://bugs.llvm.org/show_bug.cgi?id=33224 Differential Revision: https://reviews.llvm.org/D33676 llvm-svn: 310616
Diffstat (limited to 'clang/lib/Parse/ParseCXXInlineMethods.cpp')
-rw-r--r--clang/lib/Parse/ParseCXXInlineMethods.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseCXXInlineMethods.cpp b/clang/lib/Parse/ParseCXXInlineMethods.cpp
index b68559485a5..c9a895d7d54 100644
--- a/clang/lib/Parse/ParseCXXInlineMethods.cpp
+++ b/clang/lib/Parse/ParseCXXInlineMethods.cpp
@@ -518,7 +518,8 @@ void Parser::ParseLexedMethodDef(LexedMethod &LM) {
// Parse the method body. Function body parsing code is similar enough
// to be re-used for method bodies as well.
- ParseScope FnScope(this, Scope::FnScope|Scope::DeclScope);
+ ParseScope FnScope(this, Scope::FnScope | Scope::DeclScope |
+ Scope::CompoundStmtScope);
Actions.ActOnStartOfFunctionDef(getCurScope(), LM.D);
if (Tok.is(tok::kw_try)) {
OpenPOWER on IntegriCloud