File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 11
11
12
12
#include " numpy.h"
13
13
14
+ #if defined(__GNUC__)
15
+ // These suppressions are needed only for certain compilers and versions of Eigen, but:
16
+ // * Maintaining narrowly defined ifdefs is very complicated/expensive.
17
+ // * These suppressions are applied only to the Eigen headers anyway.
18
+ # pragma GCC diagnostic push
19
+ # pragma GCC diagnostic ignored "-Wconversion"
20
+ #if __GNUC__ != 8
21
+ # pragma GCC diagnostic ignored "-Wdeprecated-copy"
22
+ # pragma GCC diagnostic ignored "-Wdeprecated-copy-dtor"
23
+ #endif
24
+ #endif
25
+
14
26
#include < Eigen/Core>
15
27
#include < Eigen/SparseCore>
16
28
29
+ #if defined(__GNUC__)
30
+ # pragma GCC diagnostic pop
31
+ #endif
32
+
17
33
// Eigen prior to 3.2.7 doesn't have proper move constructors--but worse, some classes get implicit
18
34
// move constructors that break things. We could detect this an explicitly copy, but an extra copy
19
35
// of matrices seems highly undesirable.
@@ -64,8 +80,16 @@ template <bool EigenRowMajor> struct EigenConformable {
64
80
if (rstride < 0 || cstride < 0 ) {
65
81
negativestrides = true ;
66
82
} else {
83
+ #if defined(__GNUC__) && !defined(__clang__) && __GNUC__ != 8
84
+ // Suppressing warning originating from Eigen header.
85
+ # pragma GCC diagnostic push
86
+ # pragma GCC diagnostic ignored "-Wdeprecated-copy"
87
+ #endif
67
88
stride = {EigenRowMajor ? rstride : cstride /* outer stride */ ,
68
89
EigenRowMajor ? cstride : rstride /* inner stride */ };
90
+ #if defined(__GNUC__) && !defined(__clang__) && __GNUC__ != 8
91
+ # pragma GCC diagnostic pop
92
+ #endif
69
93
}
70
94
}
71
95
// Vector type:
You can’t perform that action at this time.
0 commit comments