google / s2geometry

Computational geometry and spatial indexing on the sphere
http://s2geometry.io/
Apache License 2.0
2.29k stars 302 forks source link

ce8e338 breaks MSVC on Windows #327

Closed wegylexy closed 7 months ago

wegylexy commented 1 year ago

This google3 update ce8e338067b336acc609f48b40fcf81bdf900a6c seems not standard compliant and thus breaks compiling with MSVC. For instance, there is no S2Point() constructor that takes 0 arguments.

smcallis commented 11 months ago

That's a very large update, we're going to need more information to hope to debug it. S2Point definitely has a no-argument constructor, this compiles for me:

TEST(Foo, Bar) {
  S2Point baz;
  absl::PrintF("%f %f %f\n", baz.x(), baz.y(), baz.z());
}
[ RUN      ] Foo.Bar
0.000000 0.000000 0.000000
jherico commented 8 months ago

It compiles on GCC and Clang because they treat the interaction between the using Base::Base declaration and the deletion of a default ctor in the presence of a non-trivial ctor differently. See https://godbolt.org/z/EPnsMEq8v

I've fixed this in #338

jmr commented 7 months ago

Reopen #338 if this is not fixed.