summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-07-23 21:53:24 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-07-23 21:53:24 +0000
commit946274471da40720baae5e510d2df90854973c01 (patch)
tree5b46837f85ef0b2db5e6e0aab83c05098923eee4 /clang/lib/Sema/SemaExpr.cpp
parentebb84b243b21c803105e93c7fa166a3eaba08376 (diff)
downloadbcm5719-llvm-946274471da40720baae5e510d2df90854973c01.tar.gz
bcm5719-llvm-946274471da40720baae5e510d2df90854973c01.zip
Allow __func__ and __FUNCTION__ and __PRETTY_FUNCTION__ inside blocks.
Radar 8218839. llvm-svn: 109272
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 0d53e2f8bea..8b2e0203b38 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -1856,6 +1856,8 @@ Sema::OwningExprResult Sema::ActOnPredefinedExpr(SourceLocation Loc,
// string.
Decl *currentDecl = getCurFunctionOrMethodDecl();
+ if (!currentDecl && getCurBlock())
+ currentDecl = getCurBlock()->TheDecl;
if (!currentDecl) {
Diag(Loc, diag::ext_predef_outside_function);
currentDecl = Context.getTranslationUnitDecl();
OpenPOWER on IntegriCloud