Skip to content

Fix compile error when using CATCH_CONFIG_GLOBAL_NEXTAFTER#1761

Closed
ironage wants to merge 1 commit intocatchorg:masterfrom
ironage:js/nextafter
Closed

Fix compile error when using CATCH_CONFIG_GLOBAL_NEXTAFTER#1761
ironage wants to merge 1 commit intocatchorg:masterfrom
ironage:js/nextafter

Conversation

@ironage
Copy link
Copy Markdown

@ironage ironage commented Oct 1, 2019

The function std::nextafter is not available when compiling for android (ndk r10e). This is essentially the same problem reported in #1739.

The fix that was added (b7bdaf8) adds a good workaround when using the config CATCH_CONFIG_GLOBAL_NEXTAFTER. However, when compiling with that flag enabled I get errors like this:

../tests/../external/catch/single_include/catch2/catch.hpp:12703:29: error: reference to 'Catch' is ambiguous
            auto reporter = Catch::getRegistryHub().getReporterRegistry().create(reporterName, config);
                            ^
../tests/../external/catch/single_include/catch2/catch.hpp:12697:11: note: candidate found by name lookup is 'Catch'
namespace Catch {
          ^
../tests/../external/catch/single_include/catch2/catch.hpp:11106:11: note: candidate found by name lookup is '(anonymous namespace)::Catch'
namespace Catch {
          ^

Looks like adding the namespace Catch inside an anonymous namespace causes conflicts which the compiler doesn't know how to resolve. This patch just changes the namespace name so that there is no ambiguity and the fix compiles properly.

@horenmar horenmar closed this in 4bd2c3a Oct 5, 2019
@ironage ironage deleted the js/nextafter branch October 8, 2019 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants