diff options
Diffstat (limited to 'lib/Sema/Sema.cpp')
-rw-r--r-- | lib/Sema/Sema.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp index 0259a3d18d..b839e76969 100644 --- a/lib/Sema/Sema.cpp +++ b/lib/Sema/Sema.cpp @@ -310,7 +310,8 @@ void Sema::ActOnEndOfTranslationUnit() { //===----------------------------------------------------------------------===// DeclContext *Sema::getFunctionLevelDeclContext() { - DeclContext *DC = CurContext; + DeclContext *DC = PreDeclaratorDC ? PreDeclaratorDC : CurContext; + while (isa<BlockDecl>(DC)) DC = DC->getParent(); |