summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/g++.dg/tm/pr46269.C
blob: b4b13af5bf1337aa8c067f4709836bbb15efbc3c (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
29
// { dg-do compile }
// { dg-options "-fgnu-tm" }

static inline void atomic_exchange_and_add()
{
  __asm__  ("");
}

template<class T> class shared_ptr
{
public:
  shared_ptr( T * p )
  {
    atomic_exchange_and_add();
  }
};

class BuildingCompletedEvent
{
  public:
  __attribute__((transaction_callable)) void updateBuildingSite(void);
  __attribute__((transaction_pure)) BuildingCompletedEvent();
};

void BuildingCompletedEvent::updateBuildingSite(void)
{
  shared_ptr<BuildingCompletedEvent> event(new BuildingCompletedEvent());
}

OpenPOWER on IntegriCloud