summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaChecking.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/SemaChecking.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/SemaChecking.cpp')
-rw-r--r--clang/lib/Sema/SemaChecking.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 14aa9968213..5bb78cd765d 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -883,7 +883,8 @@ static DeclRefExpr* EvalVal(Expr *E) {
// viewed AST node. We then recursively traverse the AST by calling
// EvalAddr and EvalVal appropriately.
switch (E->getStmtClass()) {
- case Stmt::DeclRefExprClass: {
+ case Stmt::DeclRefExprClass:
+ case Stmt::QualifiedDeclRefExprClass: {
// DeclRefExpr: the base case. When we hit a DeclRefExpr we are looking
// at code that refers to a variable's name. We check if it has local
// storage within the function, and if so, return the expression.
OpenPOWER on IntegriCloud