summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-29 14:49:33 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-29 14:49:33 +0000
commit82dbbd7054c17289a13b2755b1f3fd1b4190e39d (patch)
tree817fa99cbddf7cb7cac9f16ff57946e42f1e07e3 /clang
parent055809446451606b79b822b2a78623c0fb839e10 (diff)
downloadbcm5719-llvm-82dbbd7054c17289a13b2755b1f3fd1b4190e39d.tar.gz
bcm5719-llvm-82dbbd7054c17289a13b2755b1f3fd1b4190e39d.zip
Some cleanups and commenting to our declaration-name handling
llvm-svn: 72570
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 9350caaca47..f4bfefca13c 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -818,6 +818,7 @@ Sema::ActOnDeclarationNameExpr(Scope *S, SourceLocation Loc,
// An id-expression is type-dependent if it contains:
// -- a nested-name-specifier that contains a class-name that
// names a dependent type.
+ // FIXME: Member of the current instantiation.
if (SS && isDependentScopeSpecifier(*SS)) {
return Owned(new (Context) UnresolvedDeclRefExpr(Name, Context.DependentTy,
Loc, SS->getRange(),
@@ -962,17 +963,7 @@ Sema::ActOnDeclarationNameExpr(Scope *S, SourceLocation Loc,
if (!DType.isNull()) {
// The pointer is type- and value-dependent if it points into something
// dependent.
- bool Dependent = false;
- for (; DC; DC = DC->getParent()) {
- // FIXME: could stop early at namespace scope.
- if (DC->isRecord()) {
- CXXRecordDecl *Record = cast<CXXRecordDecl>(DC);
- if (Context.getTypeDeclType(Record)->isDependentType()) {
- Dependent = true;
- break;
- }
- }
- }
+ bool Dependent = DC->isDependentContext();
return Owned(BuildDeclRefExpr(D, DType, Loc, Dependent, Dependent, SS));
}
}
@@ -1083,6 +1074,9 @@ Sema::ActOnDeclarationNameExpr(Scope *S, SourceLocation Loc,
// Warn about constructs like:
// if (void *X = foo()) { ... } else { X }.
// In the else block, the pointer is always false.
+
+ // FIXME: In a template instantiation, we don't have scope
+ // information to check this property.
if (Var->isDeclaredInCondition() && Var->getType()->isScalarType()) {
Scope *CheckS = S;
while (CheckS) {
OpenPOWER on IntegriCloud