Remove workarounds for bad GCC-4 warnings

This commit is contained in:
Arthur 2022-03-16 00:08:16 +00:00 committed by Rasmus Munk Larsen
parent 9ad5661482
commit 514f90c9ff
3 changed files with 5 additions and 16 deletions

View File

@ -20,14 +20,9 @@ namespace internal {
// with mismatched types, the compiler emits errors about failing to instantiate cwiseProduct BEFORE // with mismatched types, the compiler emits errors about failing to instantiate cwiseProduct BEFORE
// looking at the static assertions. Thus this is a trick to get better compile errors. // looking at the static assertions. Thus this is a trick to get better compile errors.
template<typename T, typename U, template<typename T, typename U,
// the NeedToTranspose condition here is taken straight from Assign.h bool NeedToTranspose = T::IsVectorAtCompileTime && U::IsVectorAtCompileTime &&
bool NeedToTranspose = T::IsVectorAtCompileTime ((int(T::RowsAtCompileTime) == 1 && int(U::ColsAtCompileTime) == 1) ||
&& U::IsVectorAtCompileTime (int(T::ColsAtCompileTime) == 1 && int(U::RowsAtCompileTime) == 1))>
&& ((int(T::RowsAtCompileTime) == 1 && int(U::ColsAtCompileTime) == 1)
| // FIXME | instead of || to please GCC 4.4.0 stupid warning "suggest parentheses around &&".
// revert to || as soon as not needed anymore.
(int(T::ColsAtCompileTime) == 1 && int(U::RowsAtCompileTime) == 1))
>
struct dot_nocheck struct dot_nocheck
{ {
typedef scalar_conj_product_op<typename traits<T>::Scalar,typename traits<U>::Scalar> conj_prod; typedef scalar_conj_product_op<typename traits<T>::Scalar,typename traits<U>::Scalar> conj_prod;

View File

@ -335,8 +335,7 @@ struct has_binary_operator
template<int Y, template<int Y,
int InfX = 0, int InfX = 0,
int SupX = ((Y==1) ? 1 : Y/2), int SupX = ((Y==1) ? 1 : Y/2),
bool Done = ((SupX-InfX)<=1 ? true : ((SupX*SupX <= Y) && ((SupX+1)*(SupX+1) > Y))) > bool Done = ((SupX - InfX) <= 1 || ((SupX * SupX <= Y) && ((SupX + 1) * (SupX + 1) > Y)))>
// use ?: instead of || just to shut up a stupid gcc 4.3 warning
class meta_sqrt class meta_sqrt
{ {
enum { enum {

View File

@ -431,12 +431,7 @@ struct unary_evaluator<Block<ArgType,BlockRows,BlockCols,InnerPanel>, IteratorBa
enum { enum {
IsRowMajor = XprType::IsRowMajor, IsRowMajor = XprType::IsRowMajor,
OuterVector = (BlockCols == 1 && ArgType::IsRowMajor) || (BlockRows == 1 && !ArgType::IsRowMajor),
OuterVector = (BlockCols==1 && ArgType::IsRowMajor)
| // FIXME | instead of || to please GCC 4.4.0 stupid warning "suggest parentheses around &&".
// revert to || as soon as not needed anymore.
(BlockRows==1 && !ArgType::IsRowMajor),
CoeffReadCost = evaluator<ArgType>::CoeffReadCost, CoeffReadCost = evaluator<ArgType>::CoeffReadCost,
Flags = XprType::Flags Flags = XprType::Flags
}; };