summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-01-06 05:10:23 +0000
committerDouglas Gregor <dgregor@apple.com>2009-01-06 05:10:23 +0000
commitc7acfdfe9a6f4c5dc045ca6061b69080e01c89e4 (patch)
tree79e853b3418abe5a1203463a416ef8cf60733ff3 /clang/lib/Sema/SemaDecl.cpp
parenta8a3f73a47e7bf23e7b3f0f5dc098539d973ba81 (diff)
downloadbcm5719-llvm-c7acfdfe9a6f4c5dc045ca6061b69080e01c89e4.tar.gz
bcm5719-llvm-c7acfdfe9a6f4c5dc045ca6061b69080e01c89e4.zip
Add QualifiedDeclRefExpr, which retains additional source-location
information for declarations that were referenced via a qualified-id, e.g., N::C::value. We keep track of the location of the start of the nested-name-specifier. Note that the difference between QualifiedDeclRefExpr and DeclRefExpr does have an effect on the semantics of function calls in two ways: 1) The use of a qualified-id instead of an unqualified-id suppresses argument-dependent lookup 2) If the name refers to a virtual function, the qualified-id version will call the function determined statically while the unqualified-id version will call the function determined dynamically (by looking up the appropriate function in the vtable). Neither of these features is implemented yet, but we do print out qualified names for QualifiedDeclRefExprs as part of the AST printing. llvm-svn: 61789
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 0396f520a84..dce1e129a59 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -1570,7 +1570,8 @@ bool Sema::CheckAddressConstantExpressionLValue(const Expr* Init) {
}
case Expr::CompoundLiteralExprClass:
return cast<CompoundLiteralExpr>(Init)->isFileScope();
- case Expr::DeclRefExprClass: {
+ case Expr::DeclRefExprClass:
+ case Expr::QualifiedDeclRefExprClass: {
const Decl *D = cast<DeclRefExpr>(Init)->getDecl();
if (const VarDecl *VD = dyn_cast<VarDecl>(D)) {
if (VD->hasGlobalStorage())
@@ -1829,7 +1830,8 @@ bool Sema::CheckArithmeticConstantExpression(const Expr* Init) {
InitializerElementNotConstant(Init);
return true;
}
- case Expr::DeclRefExprClass: {
+ case Expr::DeclRefExprClass:
+ case Expr::QualifiedDeclRefExprClass: {
const Decl *D = cast<DeclRefExpr>(Init)->getDecl();
if (isa<EnumConstantDecl>(D))
return false;
OpenPOWER on IntegriCloud