-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Closed
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillalibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Description
| Bugzilla Link | 11461 |
| Resolution | FIXED |
| Resolved on | Dec 11, 2011 14:31 |
| Version | unspecified |
| OS | All |
| Reporter | LLVM Bugzilla Contributor |
Extended Description
The following code does not compile:
#include
struct A final {};
struct B { virtual ~B() final; };
int main()
{
std::tuple x; // #1
std::tuple y; // #2
}
This currently happens because of a problem in std::is_empty<> that has been reported as bug #11459. However even if we fix std::is_empty<>, only line #2 will compile. Line #1 will still trigger an error, because std::tuple will attempt to derive from the empty class type A, which is forbidden.
In order to fix the problem we should disable the empty base optimization for final classes. To achieve that, we need either an __is_final intrinsic or a (possibly library-only) trait to check if derivation from a type T is actually possible.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillalibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.