Skip to content

Don't derive the archive exceptions virtually - #373

Open
gennaroprota wants to merge 1 commit into
developfrom
fix/dont-derive-the-archive-exceptions-virtually
Open

Don't derive the archive exceptions virtually#373
gennaroprota wants to merge 1 commit into
developfrom
fix/dont-derive-the-archive-exceptions-virtually

Conversation

@gennaroprota

Copy link
Copy Markdown
Collaborator

archive_exception derived virtually from std::exception, and xml_archive_exception from archive_exception in turn, which gives both classes an implicit vbase destructor. MSVC and Clang disagree about whether the DLL owns that function or the consumer: cl never exports it and lets every consumer synthesize its own, while clang-cl exports it with the class and imports it. Therefore, a program built with clang-cl against a library built with cl failed to link.

Since virtual inheritance didn't buy much here, this removes it, leaving nothing for the two compilers to disagree about.

Fixes #321.

`archive_exception` derived virtually from `std::exception`, and
`xml_archive_exception` from `archive_exception` in turn, which gives
both classes an implicit vbase destructor.  MSVC and Clang disagree
about whether the DLL owns that function or the consumer: cl never
exports it and lets every consumer synthesize its own, while clang-cl
exports it with the class and imports it.  Therefore, a program built
with clang-cl against a library built with cl failed to link.

Since virtual inheritance didn't buy much here, this removes it, leaving
nothing for the two compilers to disagree about.

Fixes #321.
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.

clang: undefined symbol boost::archive::archive_exception

1 participant