]> granicus.if.org Git - clang/commit
Add QualifiedDeclRefExpr, which retains additional source-location
authorDouglas Gregor <dgregor@apple.com>
Tue, 6 Jan 2009 05:10:23 +0000 (05:10 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 6 Jan 2009 05:10:23 +0000 (05:10 +0000)
commit1a49af9681c350fef58e677f85ccb9a77e8e9d0a
tree77fdf978b985604b42294f186108d5cd2ddad66c
parentb31757b68afe06ba442a05775d08fe7aa0f6f889
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61789 91177308-0d34-0410-b5e6-96231b3b80d8
15 files changed:
include/clang/AST/Expr.h
include/clang/AST/ExprCXX.h
include/clang/AST/StmtNodes.def
include/clang/Basic/SourceManager.h
lib/AST/Expr.cpp
lib/AST/StmtPrinter.cpp
lib/AST/StmtSerialization.cpp
lib/Analysis/GRExprEngine.cpp
lib/CodeGen/CGExpr.cpp
lib/CodeGen/CGExprConstant.cpp
lib/Sema/Sema.h
lib/Sema/SemaChecking.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaExpr.cpp
test/SemaCXX/qualified-id-lookup.cpp