diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-09-09 21:57:58 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-09-09 21:57:58 +0000 |
commit | 2bdac73591f6decdfa61915371d59cf758b981e2 (patch) | |
tree | 6c30827d6922b315684072f96d556838f4aa7aa0 /clang/lib/Sema/IdentifierResolver.h | |
parent | 93945287b8843dde31a43a02b2ca02435d5609ad (diff) | |
download | bcm5719-llvm-2bdac73591f6decdfa61915371d59cf758b981e2.tar.gz bcm5719-llvm-2bdac73591f6decdfa61915371d59cf758b981e2.zip |
Make IdentifierResolver::isDeclInScope regard declarations of a parent 'control' scope as part of the current scope.
The 'control' scope is the 'condition' scope of if/switch/while statements and the scope that contains the for-init-statement and 'condition' of a for statement.
e.g:
if (int x = 0 /*'control' scope*/) {
// x will be regarded as part of this substatement scope.
} else {
// and as part of this substatement scope too.
}
llvm-svn: 56020
Diffstat (limited to 'clang/lib/Sema/IdentifierResolver.h')
-rw-r--r-- | clang/lib/Sema/IdentifierResolver.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/IdentifierResolver.h b/clang/lib/Sema/IdentifierResolver.h index 82c4f06196a..c661145d89f 100644 --- a/clang/lib/Sema/IdentifierResolver.h +++ b/clang/lib/Sema/IdentifierResolver.h @@ -207,7 +207,7 @@ public: /// isDeclInScope - If 'Ctx' is a function/method, isDeclInScope returns true /// if 'D' is in Scope 'S', otherwise 'S' is ignored and isDeclInScope returns /// true if 'D' belongs to the given declaration context. - static bool isDeclInScope(Decl *D, DeclContext *Ctx, Scope *S = 0); + bool isDeclInScope(Decl *D, DeclContext *Ctx, Scope *S = 0) const; /// AddDecl - Link the decl to its shadowed decl chain. void AddDecl(NamedDecl *D); |