tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

TestNonMemMovableStdAtomic.cpp (1076B)


      1 // expected-no-diagnostics
      2 
      3 #define MOZ_NEEDS_MEMMOVABLE_TYPE __attribute__((annotate("moz_needs_memmovable_type")))
      4 
      5 template<class T>
      6 class MOZ_NEEDS_MEMMOVABLE_TYPE Mover { T mForceInst; };
      7 
      8 #include <atomic>
      9 struct CustomType{};
     10 static struct {
     11  Mover<std::atomic<CustomType>>         m1;
     12  Mover<std::atomic<bool>>               m2;
     13  Mover<std::atomic<char>>               m3;
     14  Mover<std::atomic<signed char>>        m4;
     15  Mover<std::atomic<unsigned char>>      m5;
     16  Mover<std::atomic<char16_t>>           m6;
     17  Mover<std::atomic<char32_t>>           m7;
     18  Mover<std::atomic<wchar_t>>            m8;
     19  Mover<std::atomic<short>>              m9;
     20  Mover<std::atomic<unsigned short>>     m10;
     21  Mover<std::atomic<int>>                m11;
     22  Mover<std::atomic<unsigned int>>       m12;
     23  Mover<std::atomic<long>>               m13;
     24  Mover<std::atomic<unsigned long>>      m14;
     25  Mover<std::atomic<long long>>          m15;
     26  Mover<std::atomic<unsigned long long>> m16;
     27  Mover<std::atomic<void*>>              m17;
     28  Mover<std::atomic<CustomType*>>        m18;
     29 } good;