From 143c55ead2e3fa089f6a0b8af3d84560dfd6e9d6 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Fri, 27 Sep 2013 07:04:31 +0000 Subject: AST: Handle qualified array types in typeid() expressions The intent of getTypeOperand() was to yield an unqualified type. However QualType::getUnqualifiedType() does not strip away qualifiers on arrays. N.B. This worked fine when typeid() was applied to an expression because we would inject as implicit cast to the unqualified array type in the AST. llvm-svn: 191487 --- clang/lib/AST/StmtPrinter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/lib/AST/StmtPrinter.cpp') diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp index df8d2bbf09d..c94ffab9716 100644 --- a/clang/lib/AST/StmtPrinter.cpp +++ b/clang/lib/AST/StmtPrinter.cpp @@ -1307,7 +1307,7 @@ void StmtPrinter::VisitCXXConstCastExpr(CXXConstCastExpr *Node) { void StmtPrinter::VisitCXXTypeidExpr(CXXTypeidExpr *Node) { OS << "typeid("; if (Node->isTypeOperand()) { - Node->getTypeOperand().print(OS, Policy); + Node->getTypeOperandSourceInfo()->getType().print(OS, Policy); } else { PrintExpr(Node->getExprOperand()); } @@ -1317,7 +1317,7 @@ void StmtPrinter::VisitCXXTypeidExpr(CXXTypeidExpr *Node) { void StmtPrinter::VisitCXXUuidofExpr(CXXUuidofExpr *Node) { OS << "__uuidof("; if (Node->isTypeOperand()) { - Node->getTypeOperand().print(OS, Policy); + Node->getTypeOperandSourceInfo()->getType().print(OS, Policy); } else { PrintExpr(Node->getExprOperand()); } -- cgit v1.2.3