fft3dfilter icon indicating copy to clipboard operation
fft3dfilter copied to clipboard

Failed building on macOS 12

Open inflation opened this issue 4 years ago • 2 comments

/Users/inflation/workspace/fft3dfilter/fft3dfilter/FFT3DFilter.cpp:1628:20: error: constexpr variable 'planeBase' must be initialized by a constant expression
  constexpr cast_t planeBase = sizeof(pixel_t) == 4 ? 0 : cast_t(chroma ? (1 << (bits_per_pixel - 1)) : 0); // anti warning
                   ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/inflation/workspace/fft3dfilter/fft3dfilter/FFT3DFilter.cpp:1591:13: note: in instantiation of function template specialization 'FFT3DFilter::do_InitOverlapPlane<unsigned char, 8, true>' requested here
    case 8: do_InitOverlapPlane<uint8_t, 8, true>(inp0, srcp0, src_pitch); break;
            ^
/Users/inflation/workspace/fft3dfilter/fft3dfilter/FFT3DFilter.cpp:1628:82: note: implicit use of 'this' pointer is only allowed within the evaluation of a call to a 'constexpr' member function
  constexpr cast_t planeBase = sizeof(pixel_t) == 4 ? 0 : cast_t(chroma ? (1 << (bits_per_pixel - 1)) : 0); // anti warning
                                                                                 ^

inflation avatar Nov 10 '21 01:11 inflation

Strange, it seems that your compiler does not recognize 'bits_per_pixel' from template variable and would like to use 'bits_per_pixel' from class. All my compilers behave well (gcc linux, mingw win, msvc, clang, intel). Something is wrong with your environment? I have c++17 set for the whole source.

 /Users/inflation/workspace/fft3dfilter/fft3dfilter/FFT3DFilter.cpp:1628:82: note: implicit use of 'this' pointer is only allowed within the evaluation of a call to a 'constexpr' member function
  constexpr cast_t planeBase = sizeof(pixel_t) == 4 ? 0 : cast_t(chroma ? (1 << (bits_per_pixel - 1)) : 0); // anti warning

pinterf avatar Nov 10 '21 08:11 pinterf

I guess it's the quirk of Apple's Clang. Using clang from LLVM is fine.

inflation avatar Nov 10 '21 22:11 inflation