diff options
| author | Douglas Gregor <dgregor@apple.com> | 2008-12-06 00:22:45 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2008-12-06 00:22:45 +0000 |
| commit | b0846b0f5101ced59627c73d370915e5f2370ace (patch) | |
| tree | dadc73d8abfbd7948d60f88cd8ce67bcedb86cd2 /clang/lib/AST/StmtPrinter.cpp | |
| parent | 35e2cfccafd00304507e3f99ec3ecfa6168326a7 (diff) | |
| download | bcm5719-llvm-b0846b0f5101ced59627c73d370915e5f2370ace.tar.gz bcm5719-llvm-b0846b0f5101ced59627c73d370915e5f2370ace.zip | |
Add support for calls to dependent names within templates, e.g.,
template<typename T> void f(T x) {
g(x); // g is a dependent name, so don't even bother to look it up
g(); // error: g is not a dependent name
}
Note that when we see "g(", we build a CXXDependentNameExpr. However,
if none of the call arguments are type-dependent, we will force the
resolution of the name "g" and replace the CXXDependentNameExpr with
its result.
GCC actually produces a nice error message when you make this
mistake, and even offers to compile your code with -fpermissive. I'll
do the former next, but I don't plan to do the latter.
llvm-svn: 60618
Diffstat (limited to 'clang/lib/AST/StmtPrinter.cpp')
| -rw-r--r-- | clang/lib/AST/StmtPrinter.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp index 2e54777b94f..94bca638663 100644 --- a/clang/lib/AST/StmtPrinter.cpp +++ b/clang/lib/AST/StmtPrinter.cpp @@ -988,6 +988,10 @@ void StmtPrinter::VisitCXXDeleteExpr(CXXDeleteExpr *E) { PrintExpr(E->getArgument()); } +void StmtPrinter::VisitCXXDependentNameExpr(CXXDependentNameExpr *E) { + OS << E->getName()->getName(); +} + // Obj-C void StmtPrinter::VisitObjCStringLiteral(ObjCStringLiteral *Node) { |

