diff options
-rw-r--r-- | clang/test/Import/expr-with-cleanups/Inputs/S.cpp | 8 | ||||
-rw-r--r-- | clang/test/Import/expr-with-cleanups/test.cpp | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/Import/expr-with-cleanups/Inputs/S.cpp b/clang/test/Import/expr-with-cleanups/Inputs/S.cpp new file mode 100644 index 00000000000..7b69f48f681 --- /dev/null +++ b/clang/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/clang/test/Import/expr-with-cleanups/test.cpp b/clang/test/Import/expr-with-cleanups/test.cpp new file mode 100644 index 00000000000..79b76f414ec --- /dev/null +++ b/clang/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(); +} |