r286365 - [AST] Dump dependent scope member expression with its member name
Alex Lorenz via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 9 06:02:18 PST 2016
Author: arphaman
Date: Wed Nov 9 08:02:18 2016
New Revision: 286365
URL: http://llvm.org/viewvc/llvm-project?rev=286365&view=rev
Log:
[AST] Dump dependent scope member expression with its member name
Modified:
cfe/trunk/lib/AST/ASTDumper.cpp
cfe/trunk/test/Misc/ast-dump-stmt.cpp
Modified: cfe/trunk/lib/AST/ASTDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTDumper.cpp?rev=286365&r1=286364&r2=286365&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTDumper.cpp (original)
+++ cfe/trunk/lib/AST/ASTDumper.cpp Wed Nov 9 08:02:18 2016
@@ -545,6 +545,8 @@ namespace {
dumpDecl(Node->getLambdaClass());
}
void VisitSizeOfPackExpr(const SizeOfPackExpr *Node);
+ void
+ VisitCXXDependentScopeMemberExpr(const CXXDependentScopeMemberExpr *Node);
// ObjC
void VisitObjCAtCatchStmt(const ObjCAtCatchStmt *Node);
@@ -2194,6 +2196,11 @@ void ASTDumper::VisitSizeOfPackExpr(cons
dumpTemplateArgument(A);
}
+void ASTDumper::VisitCXXDependentScopeMemberExpr(
+ const CXXDependentScopeMemberExpr *Node) {
+ VisitExpr(Node);
+ OS << " " << (Node->isArrow() ? "->" : ".") << Node->getMember();
+}
//===----------------------------------------------------------------------===//
// Obj-C Expressions
Modified: cfe/trunk/test/Misc/ast-dump-stmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/ast-dump-stmt.cpp?rev=286365&r1=286364&r2=286365&view=diff
==============================================================================
--- cfe/trunk/test/Misc/ast-dump-stmt.cpp (original)
+++ cfe/trunk/test/Misc/ast-dump-stmt.cpp Wed Nov 9 08:02:18 2016
@@ -65,3 +65,19 @@ void TestDependentAllocationExpr() {
// CHECK: FunctionTemplateDecl {{.*}} TestDependentAllocationExpr
// CHECK: CXXNewExpr {{.*'T \*'$}}
// CHECK: CXXDeleteExpr {{.*'void'$}}
+
+template <typename T>
+class DependentScopeMemberExprWrapper {
+ T member;
+};
+
+template <typename T>
+void TestDependentScopeMemberExpr() {
+ DependentScopeMemberExprWrapper<T> obj;
+ obj.member = T();
+ (&obj)->member = T();
+}
+
+// CHECK: FunctionTemplateDecl {{.*}} TestDependentScopeMemberExpr
+// CHECK: CXXDependentScopeMemberExpr {{.*}} lvalue .member
+// CHECK: CXXDependentScopeMemberExpr {{.*}} lvalue ->member
More information about the cfe-commits
mailing list