Commit 1e159409 by Torvald Riegel Committed by Torvald Riegel

Fix instantiation of transaction expressions.

	gcc/cp/
	* pt.c (tsubst_copy_and_build): Handle TRANSACTION_EXPR.

	gcc/testsuite/
	* g++.dg/tm/template-2.C: New test.

From-SVN: r181601
parent b0dc7e4c
2011-11-21 Torvald Riegel <triegel@redhat.com>
* pt.c (tsubst_copy_and_build): Handle TRANSACTION_EXPR.
2011-11-21 Ed Smith-Rowland <3dw4rd@verizon.net>
PR c++/50958
......
......@@ -14290,6 +14290,10 @@ tsubst_copy_and_build (tree t,
return r;
}
case TRANSACTION_EXPR:
return tsubst_expr(t, args, complain, in_decl,
integral_constant_expression_p);
default:
/* Handle Objective-C++ constructs, if appropriate. */
{
......
2011-11-21 Torvald Riegel <triegel@redhat.com>
* g++.dg/tm/template-2.C: New test.
2011-11-21 Jakub Jelinek <jakub@redhat.com>
PR debug/50827
......
// { dg-do compile }
// { dg-options "-fgnu-tm -O -std=c++0x -fdump-tree-tmmark" }
struct TrueFalse
{
};
int global;
template<typename T> int foo()
{
return __transaction_atomic (global + 2)
+ __transaction_atomic (global + 3);
}
int f1()
{
return foo<TrueFalse>();
}
/* { dg-final { scan-tree-dump-times "ITM_RU" 2 "tmmark" } } */
/* { dg-final { cleanup-tree-dump "tmmark" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment