summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/tm/pr47573.C
blob: 1fd26896c5d7b1daf9c92043aff9358e2a68b809 (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
// Without comdat support, we don't see the body of the
// extern template class constructor, so limit this to
// known comdat targets.
// { dg-do compile { target comdat_group } }
// { dg-options "-fgnu-tm" }

template<typename _Tp> class allocator
{
	public:
	allocator() { }
};
extern template class allocator<char>;

template<typename _Alloc = allocator<char> > class basic_string
{
	public:
	_Alloc _M_dataplus;

	__attribute__((transaction_safe))
	basic_string() : _M_dataplus(_Alloc())
	{
	}
};

int getStringHeight()
{
	basic_string<> tmp;
}