From f0e035f74288501c6b0d134b6765e705ccd782f3 Mon Sep 17 00:00:00 2001 From: hogliux Date: Wed, 25 Apr 2018 12:01:00 +0100 Subject: [PATCH] Fixed a compiler error in the DSP module when using clang C++17 support --- modules/juce_dsp/processors/juce_WaveShaper.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/juce_dsp/processors/juce_WaveShaper.h b/modules/juce_dsp/processors/juce_WaveShaper.h index 037b198292..f93151d1a3 100644 --- a/modules/juce_dsp/processors/juce_WaveShaper.h +++ b/modules/juce_dsp/processors/juce_WaveShaper.h @@ -72,12 +72,14 @@ struct WaveShaper }; //============================================================================== -#if JUCE_CXX17_IS_AVAILABLE -template -static WaveShaper, Functor> CreateWaveShaper (Functor functionToUse) { return {functionToUse}; } -#else +// Although clang supports C++17, their standard library still has no invoke_result +// support. Remove the "|| JUCE_CLANG" once clang supports this properly! +#if (! JUCE_CXX17_IS_AVAILABLE) || JUCE_CLANG template static WaveShaper, Functor> CreateWaveShaper (Functor functionToUse) { return {functionToUse}; } +#else +template +static WaveShaper, Functor> CreateWaveShaper (Functor functionToUse) { return {functionToUse}; } #endif } // namespace dsp