From: Raphael Isemann Date: Wed, 15 Aug 2018 22:51:37 +0000 (+0000) Subject: [ASTImporter] Add test for ExprWithCleanups X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=59a92a4aa354eee24286570e16b933ec9841951e;p=clang [ASTImporter] Add test for ExprWithCleanups Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: a_sidorin, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D50731 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339830 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Import/expr-with-cleanups/Inputs/S.cpp b/test/Import/expr-with-cleanups/Inputs/S.cpp new file mode 100644 index 0000000000..7b69f48f68 --- /dev/null +++ b/test/Import/expr-with-cleanups/Inputs/S.cpp @@ -0,0 +1,8 @@ +struct RAII { + int i = 0; + RAII() { i++; } + ~RAII() { i--; } +}; +void f() { + RAII(); +} diff --git a/test/Import/expr-with-cleanups/test.cpp b/test/Import/expr-with-cleanups/test.cpp new file mode 100644 index 0000000000..79b76f414e --- /dev/null +++ b/test/Import/expr-with-cleanups/test.cpp @@ -0,0 +1,8 @@ +// RUN: clang-import-test -dump-ast -import %S/Inputs/S.cpp -expression %s | FileCheck %s +// CHECK: ExprWithCleanups +// CHECK-SAME: 'RAII' +// CHECK-NEXT: CXXBindTemporaryExpr + +void expr() { + f(); +}