Skip to content

Conversation

rschu1ze
Copy link
Contributor

@rschu1ze rschu1ze commented Jul 5, 2024

Found while upgrading LLVM in ClickHouse (which uses s2geometry).

The code is structured like this:

class S2Polyline {

  class OwningShape {
      std::unique_ptr<S2Polyline> owned_polyline_;
  };
};

libcxx 16 complains that S2Polyline is not defined at the point where
the dtor of the unique_ptr is called (which is OwningShape's implicitly
declared default destructor in the same header file) (also see [0]).

As a remedy, declare OwningShape's destructor in the source file where
the full declaration of S2Polyline is visible.

[0] https://stackoverflow.com/a/34073093/22422288)

The code is structured like this:

```
class S2Polyline {

  class OwningShape {
      std::unique_ptr<S2Polyline> owned_polyline_;
  };
};
```

libcxx 16 complains that S2Polyline is not defined at the point where
the dtor of the unique_ptr is called (which is OwningShape's implicitly
declared default destructor in the same header file) (also see [0]).

As a remedy, declare OwningShape's destructor in the source file where
the full declaration of S2Polyline is visible.

[0] https://stackoverflow.com/a/34073093/22422288)
@rschu1ze rschu1ze requested a review from jmr July 5, 2024 13:19
@jmr jmr merged commit ec260c3 into google:master Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants