Last active
August 29, 2015 14:19
-
-
Save dgodfrey206/2b9d59207aa8881bfed4 to your computer and use it in GitHub Desktop.
GCC bug with using-declaration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Base { | |
Base(int) {} | |
}; | |
struct D1 : virtual Base { | |
using Base::Base; | |
}; | |
int main() { | |
static_assert(std::is_constructible<D1, int>::value, ""); // FAILS | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There seems to be a bug in gcc where a using-declaration in a class
D1
inheriting the constructors of a virtual base classBase
implicitly odr-usesBase
's default constructor. This shouldn't be the case unless a most derived class calls the constructor ofBase
, in which caseD1
then callsBase
's default-constructor.