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