FontMap changes do not compile on macOS

This change has broken the build: https://github.com/juce-framework/JUCE/commit/50dacbc8fc2fd386bdddef998a95d6e942bf3697#diff-51ab0e260a076f918d5485b175af0040bb0e4585b1798b92d45a28adfd5e9d64

Xcode 13.2.1 - Use latest C++ standard

Example project here: https://github.com/FigBug/juce_bugs/tree/master/CantCompile

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/algorithm:712:71: Function 'operator<' with deduced return type cannot be used before it is defined
/Users/rrabien/dev.github/Nexus4/modules/Hades/Tools/HardwareId/JuceLibraryCode/include_juce_graphics.mm:9:10: in file included from /Users/rrabien/dev.github/Nexus4/modules/Hades/Tools/HardwareId/JuceLibraryCode/include_juce_graphics.mm:9:
/Users/rrabien/dev.github/Nexus4/modules/JUCE/modules/juce_graphics/juce_graphics.mm:26:10: in file included from /Users/rrabien/dev.github/Nexus4/modules/JUCE/modules/juce_graphics/juce_graphics.mm:26:
/Users/rrabien/dev.github/Nexus4/modules/JUCE/modules/juce_graphics/juce_graphics.cpp:41:10: in file included from /Users/rrabien/dev.github/Nexus4/modules/JUCE/modules/juce_graphics/juce_graphics.cpp:41:
/Users/rrabien/dev.github/Nexus4/modules/JUCE/modules/juce_graphics/juce_graphics.h:58:10: in file included from /Users/rrabien/dev.github/Nexus4/modules/JUCE/modules/juce_graphics/juce_graphics.h:58:
/Users/rrabien/dev.github/Nexus4/modules/JUCE/modules/juce_core/juce_core.h:204:10: in file included from /Users/rrabien/dev.github/Nexus4/modules/JUCE/modules/juce_core/juce_core.h:204:
/Users/rrabien/dev.github/Nexus4/modules/JUCE/modules/juce_core/system/juce_StandardHeader.h:46:10: in file included from /Users/rrabien/dev.github/Nexus4/modules/JUCE/modules/juce_core/system/juce_StandardHeader.h:46:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/algorithm:4355:13: In instantiation of member function 'std::__less<juce::CoreTextTypeLayout::FontMap::Pair, const __CTFont *>::operator()' requested here
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/algorithm:4373:19: In instantiation of function template specialization 'std::__lower_bound<std::__less<juce::CoreTextTypeLayout::FontMap::Pair, const __CTFont *> &, std::__wrap_iter<juce::CoreTextTypeLayout::FontMap::Pair *>, const __CTFont *>' requested here
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/algorithm:4382:19: In instantiation of function template specialization 'std::lower_bound<std::__wrap_iter<juce::CoreTextTypeLayout::FontMap::Pair *>, const __CTFont *, std::__less<juce::CoreTextTypeLayout::FontMap::Pair, const __CTFont *>>' requested here
/Users/rrabien/dev.github/Nexus4/modules/JUCE/modules/juce_graphics/native/juce_mac_Fonts.mm:217:33: In instantiation of function template specialization 'std::lower_bound<std::__wrap_iter<juce::CoreTextTypeLayout::FontMap::Pair *>, const __CTFont *>' requested here
/Users/rrabien/dev.github/Nexus4/modules/JUCE/modules/juce_graphics/native/juce_mac_Fonts.mm:238:18: 'operator<' declared here
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/algorithm:4355:13: No matching function for call to object of type 'std::__less<juce::CoreTextTypeLayout::FontMap::Pair, const __CTFont *>'
/Users/rrabien/dev.github/Nexus4/modules/Hades/Tools/HardwareId/JuceLibraryCode/include_juce_graphics.mm:9:10: in file included from /Users/rrabien/dev.github/Nexus4/modules/Hades/Tools/HardwareId/JuceLibraryCode/include_juce_graphics.mm:9:
/Users/rrabien/dev.github/Nexus4/modules/JUCE/modules/juce_graphics/juce_graphics.mm:26:10: in file included from /Users/rrabien/dev.github/Nexus4/modules/JUCE/modules/juce_graphics/juce_graphics.mm:26:
/Users/rrabien/dev.github/Nexus4/modules/JUCE/modules/juce_graphics/juce_graphics.cpp:41:10: in file included from /Users/rrabien/dev.github/Nexus4/modules/JUCE/modules/juce_graphics/juce_graphics.cpp:41:
/Users/rrabien/dev.github/Nexus4/modules/JUCE/modules/juce_graphics/juce_graphics.h:58:10: in file included from /Users/rrabien/dev.github/Nexus4/modules/JUCE/modules/juce_graphics/juce_graphics.h:58:
/Users/rrabien/dev.github/Nexus4/modules/JUCE/modules/juce_core/juce_core.h:204:10: in file included from /Users/rrabien/dev.github/Nexus4/modules/JUCE/modules/juce_core/juce_core.h:204:
/Users/rrabien/dev.github/Nexus4/modules/JUCE/modules/juce_core/system/juce_StandardHeader.h:46:10: in file included from /Users/rrabien/dev.github/Nexus4/modules/JUCE/modules/juce_core/system/juce_StandardHeader.h:46:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/algorithm:4373:19: In instantiation of function template specialization 'std::__lower_bound<std::__less<juce::CoreTextTypeLayout::FontMap::Pair, const __CTFont *> &, std::__wrap_iter<const juce::CoreTextTypeLayout::FontMap::Pair *>, const __CTFont *>' requested here
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/algorithm:4382:19: In instantiation of function template specialization 'std::lower_bound<std::__wrap_iter<const juce::CoreTextTypeLayout::FontMap::Pair *>, const __CTFont *, std::__less<juce::CoreTextTypeLayout::FontMap::Pair, const __CTFont *>>' requested here
/Users/rrabien/dev.github/Nexus4/modules/JUCE/modules/juce_graphics/native/juce_mac_Fonts.mm:222:36: In instantiation of function template specialization 'std::lower_bound<std::__wrap_iter<const juce::CoreTextTypeLayout::FontMap::Pair *>, const __CTFont *>' requested here
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/algorithm:709:10: Candidate function not viable: cannot convert argument of incomplete type 'const __CTFont *const' to 'const juce::CoreTextTypeLayout::FontMap::Pair' for 2nd argument
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/algorithm:718:10: Candidate function not viable: no known conversion from 'const juce::CoreTextTypeLayout::FontMap::Pair' to 'const __CTFont *const' for 1st argument
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/algorithm:715:10: Candidate function not viable: no known conversion from 'const juce::CoreTextTypeLayout::FontMap::Pair' to 'const __CTFont *const' for 1st argument

Opened pull request:

1 Like

Thanks for reporting, fixed here:

1 Like