Skip to content
Snippets Groups Projects
Commit d16fbf60 authored by Luc Hermitte's avatar Luc Hermitte Committed by Cédric Traizet
Browse files

COMP: Fix Variadic Input Image Filters for g++8.2.0

With recent compilers, these two filters present the following compilation
errors.

    [ 62%] Building CXX object Modules/Applications/AppClassification/app/CMakeFiles/otbapp_ZonalStatistics.dir/otbZonalStatistics.cxx.o
    In file included from src/otb/Modules/Core/Functor/include/otbVariadicNamedInputsImageFilter.h:23,
                     from src/otb/Modules/Core/Functor/include/otbFunctorImageFilter.h:24,
                     from src/otb/Modules/Applications/AppClassification/app/otbZonalStatistics.cxx:41:
    src/otb/Modules/Core/Functor/include/otbVariadicInputsImageFilter.h: In member function ‘auto otb::VariadicInputsImageFilter<TOuptut, TInputs>::GetInputsImpl(std::index_sequence<Is ...>)’:
    src/otb/Modules/Core/Functor/include/otbVariadicInputsImageFilter.h:154:47: error: expected primary-expression before ‘)’ token
         return std::make_tuple(this->GetInput<Is>()...);
                                                   ^
    In file included from src/otb/Modules/Core/Functor/include/otbFunctorImageFilter.h:24,
                     from src/otb/Modules/Applications/AppClassification/app/otbZonalStatistics.cxx:41:
    src/otb/Modules/Core/Functor/include/otbVariadicNamedInputsImageFilter.h: In member function ‘void otb::VariadicNamedInputsImageFilter<TOuptut, TInputNameMap, TInputs>::SetInput(Tag, otb::VariadicNamedInputsImageFilter<TOuptut, TInputNameMap, TInputs>::InputImageType<otb::internal::tuple_index<Tag, TInputNameMap>::value>*)’:
    src/otb/Modules/Core/Functor/include/otbVariadicNamedInputsImageFilter.h:141:17: error: expected primary-expression before ‘>’ token
         SetInput<Tag>(inputPtr);
                     ^
    src/otb/Modules/Core/Functor/include/otbVariadicNamedInputsImageFilter.h: In member function ‘otb::VariadicNamedInputsImageFilter<TOuptut, TInputNameMap, TInputs>::InputImageType<otb::internal::tuple_index<Tag, TInputNameMap>::value>* otb::VariadicNamedInputsImageFilter<TOuptut, TInputNameMap, TInputs>::GetInput(Tag)’:
    src/otb/Modules/Core/Functor/include/otbVariadicNamedInputsImageFilter.h:164:24: error: expected primary-expression before ‘>’ token
         return GetInput<Tag>();
                            ^
    src/otb/Modules/Core/Functor/include/otbVariadicNamedInputsImageFilter.h:164:26: error: expected primary-expression before ‘)’ token
         return GetInput<Tag>();
                              ^
    In file included from src/otb/Modules/Core/Functor/include/otbVariadicNamedInputsImageFilter.h:23,
                     from src/otb/Modules/Core/Functor/include/otbFunctorImageFilter.h:24,
                     from src/otb/Modules/Applications/AppClassification/app/otbZonalStatistics.cxx:41:
    src/otb/Modules/Core/Functor/include/otbVariadicInputsImageFilter.h: In instantiation of ‘auto otb::VariadicInputsImageFilter<TOuptut, TInputs>::GetInputsImpl(std::index_sequence<Is ...>) [with long unsigned int ...Is = {0}; TOuptut = otb::VectorImage<float, 2>; TInputs = {otb::Image<int, 2>}; std::index_sequence<Is ...> = std::integer_sequence<long unsigned int, 0>]’:
    src/otb/Modules/Core/Functor/include/otbVariadicInputsImageFilter.h:133:72:   required from ‘auto otb::VariadicInputsImageFilter<TOuptut, TInputs>::GetInputs() [with TOuptut = otb::VectorImage<float, 2>; TInputs = {otb::Image<int, 2>}]’
    src/otb/Modules/Core/Functor/include/otbFunctorImageFilter.hxx:298:73:   required from ‘void otb::FunctorImageFilter<TFunction, TNameMap>::GenerateInputRequestedRegion() [with TFunction = otb::Wrapper::ZonalStatistics::EncoderFunctorType<int, itk::VariableLengthVector<float> >; TNameMap = void ’
    src/otb/Modules/Core/Functor/include/otbFunctorImageFilter.hxx:289:6:   required from here
    src/otb/Modules/Core/Functor/include/otbVariadicInputsImageFilter.h:154:42: error: invalid operands of types ‘<unresolved overloaded function type>’ and ‘long unsigned int’ to binary ‘operator<’
         return std::make_tuple(this->GetInput<Is>()...);
                                ~~~~~~~~~~~~~~^~~
    In file included from src/otb/Modules/Core/Functor/include/otbFunctorImageFilter.h:500,
                     from src/otb/Modules/Applications/AppClassification/app/otbZonalStatistics.cxx:41:
    src/otb/Modules/Core/Functor/include/otbFunctorImageFilter.hxx: In instantiation of ‘void otb::FunctorImageFilter<TFunction, TNameMap>::GenerateInputRequestedRegion() [with TFunction = otb::Wrapper::ZonalStatistics::EncoderFunctorType<int, itk::VariableLengthVector<float> >; TNameMap = void]’:
    src/otb/Modules/Core/Functor/include/otbFunctorImageFilter.hxx:289:6:   required from here
    src/otb/Modules/Core/Functor/include/otbFunctorImageFilter.hxx:298:73: error: invalid use of void expression
       functor_filter_details::SetInputRequestedRegions<InputHasNeighborhood>(this->GetInputs(), requestedRegion, m_Radius);
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    src/otb/Modules/Core/Functor/include/otbFunctorImageFilter.hxx: In instantiation of ‘void otb::FunctorImageFilter<TFunction, TNameMap>::GenerateOutputInformation() [with TFunction = otb::Wrapper::ZonalStatistics::EncoderFunctorType<int, itk::VariableLengthVector<float> >; TNameMap = void]’:
    src/otb/Modules/Core/Functor/include/otbFunctorImageFilter.hxx:302:6:   required from here
    src/otb/Modules/Core/Functor/include/otbFunctorImageFilter.hxx:308:8: error: ‘void inputs’ has incomplete type
       auto inputs = this->GetInputs();
            ^~~~~~
    src/otb/Modules/Core/Functor/include/otbFunctorImageFilter.hxx: In instantiation of ‘void otb::FunctorImageFilter<TFunction, TNameMap>::ThreadedGenerateData(const OutputImageRegionType&, itk::ThreadIdType) [with TFunction = otb::Wrapper::ZonalStatistics::EncoderFunctorType<int, itk::VariableLengthVector<float> >; TNameMap = void; otb::FunctorImageFilter<TFunction, TNameMap>::OutputImageRegionType = itk::ImageRegion<2>; itk::ThreadIdType = unsigned int]’:
    src/otb/Modules/Core/Functor/include/otbFunctorImageFilter.hxx:321:6:   required from here
    src/otb/Modules/Core/Functor/include/otbFunctorImageFilter.hxx:336:62: error: invalid use of void expression
       auto inputIterators = functor_filter_details::MakeIterators(this->GetInputs(), outputRegionForThread, m_Radius, InputHasNeighborhood{});
                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    make[5]: *** [Modules/Applications/AppClassification/app/CMakeFiles/otbapp_ZonalStatistics.dir/otbZonalStatistics.cxx.o] Error 1
    make[4]: *** [Modules/Applications/AppClassification/app/CMakeFiles/otbapp_ZonalStatistics.dir/all] Error 2
parent 90bfc449
Branches
Tags
No related merge requests found
...@@ -145,13 +145,13 @@ private: ...@@ -145,13 +145,13 @@ private:
template <class Tuple, size_t... Is> template <class Tuple, size_t... Is>
auto SetInputsImpl(Tuple& t, std::index_sequence<Is...>) auto SetInputsImpl(Tuple& t, std::index_sequence<Is...>)
{ {
return std::initializer_list<int>{(this->SetInput<Is>(std::get<Is>(t)), 0)...}; return std::initializer_list<int>{(this->template SetInput<Is>(std::get<Is>(t)), 0)...};
} }
template <size_t... Is> template <size_t... Is>
auto GetInputsImpl(std::index_sequence<Is...>) auto GetInputsImpl(std::index_sequence<Is...>)
{ {
return std::make_tuple(this->GetInput<Is>()...); return std::make_tuple(this->template GetInput<Is>()...);
} }
VariadicInputsImageFilter(const Self&) = delete; VariadicInputsImageFilter(const Self&) = delete;
......
...@@ -138,7 +138,7 @@ public: ...@@ -138,7 +138,7 @@ public:
template <typename Tag> template <typename Tag>
void SetInput(Tag, const InputImageType<internal::tuple_index<Tag, TInputNameMap>::value>* inputPtr) void SetInput(Tag, const InputImageType<internal::tuple_index<Tag, TInputNameMap>::value>* inputPtr)
{ {
SetInput<Tag>(inputPtr); this->template SetInput<Tag>(inputPtr);
} }
/** /**
...@@ -161,7 +161,7 @@ public: ...@@ -161,7 +161,7 @@ public:
template <typename Tag> template <typename Tag>
const InputImageType<internal::tuple_index<Tag, TInputNameMap>::value>* GetInput(Tag) const InputImageType<internal::tuple_index<Tag, TInputNameMap>::value>* GetInput(Tag)
{ {
return GetInput<Tag>(); return this->template GetInput<Tag>();
} }
protected: protected:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment