Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:51

0001 #include "FWCore/Utilities/interface/thread_safety_macros.h"
0002 
0003 class Foo
0004 {
0005 public:
0006     void bar()
0007     {
0008         // will produce a warning by StaticLocalChecker
0009             CMS_THREAD_SAFE static int evilStaticLocal = 0;
0010         static int & intRef = evilStaticLocal;
0011         static int * intPtr = & evilStaticLocal;
0012 
0013         // no warnings here
0014         static const int c_evilStaticLocal = 0;
0015         static int const& c_intRef = evilStaticLocal;
0016         static int const* c_intPtr = &evilStaticLocal;
0017         static const int * c_intPtr_equivalent = &evilStaticLocal;
0018 
0019         static int const* const* c_intPtrPtr = &( c_intPtr);
0020     }
0021 };
0022 
0023 int main()
0024 {
0025     return 0;
0026 }
0027