summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/tm/pr47746.C
blob: 61082976e67b528e3ad7ade698ae8fdc6384074c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// { dg-do compile }
// { dg-options "-fgnu-tm" }
/* { dg-add-options bind_pic_locally } */

class InputStream
{
	public:
	virtual unsigned int readUint32 () = 0;
};

class Building
{
	public:
	__attribute__((transaction_safe)) Building (InputStream *stream);
	__attribute__((transaction_safe)) void freeGradients ();
	void load (InputStream *stream);
};

Building::Building (InputStream *stream)
{
	load(stream);
}

void Building::load (InputStream *stream)
{
	int j = (int)stream->readUint32 ();
	freeGradients ();
}