summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/tm/noexcept-5.C
diff options
context:
space:
mode:
authorTorvald Riegel <triegel@redhat.com>2011-12-12 12:05:37 +0000
committerTorvald Riegel <torvald@gcc.gnu.org>2011-12-12 12:05:37 +0000
commitf0f3286a5a9af9c4b0d0af7a567c4f465f8fc382 (patch)
treeb258a4e01b1d5c494d1ec5b230e7af9499701e88 /gcc/testsuite/g++.dg/tm/noexcept-5.C
parentf2162c3daa351c9ceeceaea0f033595f90f858ca (diff)
downloadgcc-f0f3286a5a9af9c4b0d0af7a567c4f465f8fc382.tar.gz
Support noexcept-specifications for transaction statements and expressions.
gcc/cp/ * semantics.c (finish_transaction_stmt, build_transaction_expr): Accept new noexcept parameter and handle it. * cp-tree.h (finish_transaction_stmt, build_transaction_expr): Adapt declarations. * parser.c (cp_parser_exception_specification_opt): Extract noexcept-specification parsing to ... (cp_parser_noexcept_specification_opt): ...here. Allow for parsing non-constexpr noexcept arguments. (cp_parser_transaction, cp_parser_transaction_expression): Parse and handle noexcept-specifications. (cp_parser_function_transaction): Adapt to finish_transaction_stmt change. * pt.c (tsubst_expr): Adapt to new noexcept parameters when building transactions. gcc/testsuite/ * g++.dg/tm/noexcept-1.C: New test. * g++.dg/tm/noexcept-2.C: New test. * g++.dg/tm/noexcept-3.C: New test. * g++.dg/tm/noexcept-4.C: New test. * g++.dg/tm/noexcept-5.C: New test. From-SVN: r182234
Diffstat (limited to 'gcc/testsuite/g++.dg/tm/noexcept-5.C')
-rw-r--r--gcc/testsuite/g++.dg/tm/noexcept-5.C21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/tm/noexcept-5.C b/gcc/testsuite/g++.dg/tm/noexcept-5.C
new file mode 100644
index 00000000000..44ef6177e6f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tm/noexcept-5.C
@@ -0,0 +1,21 @@
+// { dg-do compile }
+// { dg-options "-fgnu-tm -O -std=c++0x -fdump-tree-tmmark -fdump-tree-tmlower" }
+
+int global;
+
+void f2(int x)
+{
+ __transaction_atomic
+ {
+ __transaction_atomic noexcept(true)
+ {
+ global += 1;
+ if (x)
+ throw 23;
+ }
+ }
+}
+/* { dg-final { scan-tree-dump-times "eh_must_not_throw" 1 "tmlower" } } */
+/* { dg-final { scan-tree-dump-times "ITM_RU" 1 "tmmark" } } */
+/* { dg-final { cleanup-tree-dump "tmmark" } } */
+/* { dg-final { cleanup-tree-dump "tmlower" } } */