File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,6 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
34
34
add_definitions ("-D_DEBUG" )
35
35
endif ()
36
36
37
- add_compile_options ("-Werror=global-constructors" )
38
-
39
37
# Default to C++17
40
38
set (CMAKE_CXX_STANDARD 17 )
41
39
Original file line number Diff line number Diff line change @@ -32,7 +32,10 @@ int GLOBAL_INDEX = 512;
32
32
int INITVAL_INITIALIZER = 0x600D ;
33
33
int BEFORE_INITIALIZER = 0xFEED ;
34
34
35
- static A global (GLOBAL_INDEX, INITVAL_INITIALIZER);
35
+ #pragma GCC diagnostic push
36
+ #pragma GCC diagnostic ignored "-Wglobal-constructors"
37
+ A global (GLOBAL_INDEX, INITVAL_INITIALIZER);
38
+ #pragma GCC diagnostic pop
36
39
37
40
int initval = 0 ;
38
41
int before = 0 ;
Original file line number Diff line number Diff line change @@ -31,7 +31,10 @@ class A {
31
31
int GLOBAL_INDEX = 512 ;
32
32
int INITVAL_INITIALIZER = 0x600D ;
33
33
34
+ #pragma GCC diagnostic push
35
+ #pragma GCC diagnostic ignored "-Wglobal-constructors"
34
36
A global (GLOBAL_INDEX, INITVAL_INITIALIZER);
37
+ #pragma GCC diagnostic pop
35
38
36
39
int initval = 0 ;
37
40
int preinitval = 0 ;
You can’t perform that action at this time.
0 commit comments