diff options
| author | Martin Hořeňovský | 2020-10-02 23:22:49 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2020-10-08 11:41:05 +0200 |
| commit | b601b7facadf8053d36b548d19d91a6cfe90acbd (patch) | |
| tree | 1d3ec5c22395c76dbea878f6974a2ece595e5674 /src/catch2/internal | |
| parent | b841650253975d6acd9a58f408eba0f91e366747 (diff) | |
| download | catch3-b601b7facadf8053d36b548d19d91a6cfe90acbd.tar.gz | |
Workaround AppleClang bug by renaming TestHasher constructor argument
As far as I understand the standard, if there is a function called
`rng` in the global namespace, and a function argument called `rng`,
then the argument should shadow the function. This then means that
uses of `rng` inside the function should refer to the argument.
This is not the case for AppleClang 12.0.0. Luckily the workaround
is simple enough; just rename the argument. Given that the function
is 3 lines and uncomplicated, the change of the name doesn't really
affect readability.
Still, WTF AppleClang?
Closes #2030
Diffstat (limited to 'src/catch2/internal')
| -rw-r--r-- | src/catch2/internal/catch_test_case_registry_impl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/catch2/internal/catch_test_case_registry_impl.cpp b/src/catch2/internal/catch_test_case_registry_impl.cpp index 572d3915..7f7f101d 100644 --- a/src/catch2/internal/catch_test_case_registry_impl.cpp +++ b/src/catch2/internal/catch_test_case_registry_impl.cpp @@ -23,10 +23,10 @@ namespace Catch { namespace { struct HashTest { - explicit HashTest(SimplePcg32& rng) { - basis = rng(); + explicit HashTest(SimplePcg32& rng_inst) { + basis = rng_inst(); basis <<= 32; - basis |= rng(); + basis |= rng_inst(); } uint64_t basis; |