Skip to content

Instantly share code, notes, and snippets.

@EricWF

EricWF/repro.cpp Secret

Last active February 3, 2018 00:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EricWF/588a361030edeaebbbc1155b8347cab0 to your computer and use it in GitHub Desktop.
Save EricWF/588a361030edeaebbbc1155b8347cab0 to your computer and use it in GitHub Desktop.
// clang++ -std=c++03 -fsyntax-only test.cpp
struct base { virtual ~base(); };
template <bool B>
struct invalid_base : base {
_Static_assert(B, ""); // assert must come before dtor decl
virtual ~invalid_base();
};
template <bool B, int Dummy>
struct virtual_base : virtual invalid_base<B> {
virtual ~virtual_base(); // must be declared
};
template <bool B>
struct test_type : virtual virtual_base<B, 1>,
virtual virtual_base<B, 2> {
test_type();
};
test_type<false> b;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment