Debian Codegraph @

gcc/testsuite/g++.dg/pr67989.C

raw
1 /* { dg-do compile } */
2 /* { dg-options "-std=c++11 -O2 -Wno-return-type" } */
3
4 __extension__ typedef unsigned long long int uint64_t;
5 namespace std __attribute__ ((__visibility__ ("default")))
6 {
7 typedef enum memory_order
8 {
9 memory_order_seq_cst
10 } memory_order;
11 }
12
13 namespace std __attribute__ ((__visibility__ ("default")))
14 {
15 template < typename _Tp > struct atomic
16 {
17 static constexpr int _S_min_alignment
18 = (sizeof (_Tp) & (sizeof (_Tp) - 1)) || sizeof (_Tp) > 16
19 ? 0 : sizeof (_Tp);
20 static constexpr int _S_alignment
21 = _S_min_alignment > alignof (_Tp) ? _S_min_alignment : alignof (_Tp);
22 alignas (_S_alignment) _Tp _M_i;
23 operator _Tp () const noexcept
24 {
25 return load ();
26 }
27 _Tp load (memory_order __m = memory_order_seq_cst) const noexcept
28 {
29 _Tp tmp;
30 __atomic_load (&_M_i, &tmp, __m);
31 }
32 };
33 }
34
35 namespace lldb_private
36 {
37 namespace imp
38 {
39 }
40 class Address;
41 }
42 namespace lldb
43 {
44 typedef uint64_t addr_t;
45 class SBSection
46 {
47 };
48 class SBAddress
49 {
50 void SetAddress (lldb::SBSection section, lldb::addr_t offset);
51 lldb_private::Address & ref ();
52 };
53 }
54 namespace lldb_private
55 {
56 class Address
57 {
58 public:
59 const Address & SetOffset (lldb::addr_t offset)
60 {
61 bool changed = m_offset != offset;
62 }
63 std::atomic < lldb::addr_t > m_offset;
64 };
65 }
66
67 using namespace lldb;
68 using namespace lldb_private;
69 void
70 SBAddress::SetAddress (lldb::SBSection section, lldb::addr_t offset)
71 {
72 Address & addr = ref ();
73 addr.SetOffset (offset);
74 }