diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-09-08 00:15:04 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-09-08 00:15:04 +0000 |
commit | ab6677ec401cfd2c82b34e4cdfebd55a9dc25778 (patch) | |
tree | 37b27674e508f86c56984ccadc676068814582c9 /lib/AST/StmtPrinter.cpp | |
parent | 09349145d7e9b2142a9cef94e30eb8b70ce99bdc (diff) |
Provide proper type-source location information for
CXXTemporaryObjectExpr, CXXScalarValueInitExpr, and
CXXUnresolvedConstructExpr, getting rid of a bunch of FIXMEs in the
process.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113319 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/StmtPrinter.cpp')
-rw-r--r-- | lib/AST/StmtPrinter.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp index 5236a66726..1778ce84d1 100644 --- a/lib/AST/StmtPrinter.cpp +++ b/lib/AST/StmtPrinter.cpp @@ -18,6 +18,7 @@ #include "clang/AST/PrettyPrinter.h" #include "llvm/Support/Format.h" #include "clang/AST/Expr.h" +#include "clang/AST/ExprCXX.h" using namespace clang; //===----------------------------------------------------------------------===// @@ -1051,7 +1052,10 @@ void StmtPrinter::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *Node) { } void StmtPrinter::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *Node) { - OS << Node->getType().getAsString(Policy) << "()"; + if (TypeSourceInfo *TSInfo = Node->getTypeSourceInfo()) + OS << TSInfo->getType().getAsString(Policy) << "()"; + else + OS << Node->getType().getAsString(Policy) << "()"; } void StmtPrinter::VisitCXXNewExpr(CXXNewExpr *E) { |