Open WildRackoon opened 2 years ago
Interesting. Clang usually includes a message describing why each candidate was or wasn't rejected.
It would be good to know which overloads are really ambiguous and which is the expected overload before deciding the best solution.
In general, we don't even usually need _MSC_VER
to go into CMakeLists.txt.
Interesting. Clang usually includes a message describing why each candidate was or wasn't rejected.
Exactly, I am very puzzled by this, I feel like it does not try to instantiate the variadic template before failing to choose a candidate.
I have this for now: https://github.com/alandefreitas/matplotplusplus/compare/master...WildRackoon:matplotplusplus:fix-ambiguous-legend , but I am unsure if this is sufficient I have to test on MSVC.
Speaking of tests I am unsure how to run it, see #294.
Exactly, I am very puzzled by this, I feel like it does not try to instantiate the variadic template before failing to choose a candidate.
Yes. It's important to know which are the ambiguous and expected overloads. We can do that by elimination, but clang usually has good messages to help with that.
This is probably a sensitive issue, since these were not ambiguous overloads before, so making guesses until we get it right is likely to break the API for other platforms.
Speaking of tests I am unsure how to run it, see https://github.com/alandefreitas/matplotplusplus/discussions/294.
Regarding the tests for new PRs, we just need the tests in the GHA workflow in /.github/workflows/build.yml
. These scripts basically ensure all examples compile for each platform/compiler.
There are no real unit tests for the library because it's not easy to come up with unit tests for graphical applications. I had an idea based on image fingerprints at some point but it doesn't seem worth it at this point.
Okay got it, it is alright visual testing is a hard issue.
I was also confused by the ctest command in the workflow, that must had been added by default because it does not run anything.
Yes. Probably. I use ctest
in all libraries but this one.
I encountered this problem on macos Ventura.
@wahello were you able to fix it? I am experiencing this issue on Monterrey.
I am having this problem on Monterey. It works with gcc, but failed with clang. Also, it failed debug build:
[ 2%] Building CXX object source/matplot/CMakeFiles/matplot.dir/util/world_cities.cpp.o
[ 2%] Building CXX object source/matplot/CMakeFiles/matplot.dir/util/world_map_10m.cpp.o
/Users/nourgaliev1/INSTALL/matplotplusplus/matplotplusplus/source/matplot/util/contourc.cpp:399:24: error: variable 'npoints' set but not used [-Werror,-Wunused-but-set-variable]
size_t npoints = static_cast
It can be fixed by simply adding (void)npoints
But I think this should be fixed in distribution.
Bug category
Platform
Environment Details: Ubuntu 22.04.1 LTS CMake Ninja Clang version 14.0.0-1ubuntu1 x86_64 c++17
Describe the bug I have the same issue as #15 but in reverse: Removing the MSVC anonymous namespace hack makes it work for Clang 14
Compilation Log
Recommendations Frankly, I can't figure a way to fix those compilation quirks in a proper manner for both compilers. However, I see the CMakeLists already has HACKS options
We could simply detect the macro
#ifdef _MSC_VER
to conditionnally enable this anonymous namespace ? We should also pinpoint the exact MSVC version in which it fails and act accordingly, it is probably fixed in newer ones ?I can take care of this if you want.