http://llvm.org/bugs/show_bug.cgi?id=11461
Bug #: 11461
Summary: std::tuple chokes on final
Product: libc++
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: All Bugs
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Classification: Unclassified
The following code does not compile:
#include <utility>
struct A final {};
struct B { virtual ~B() final; };
int main()
{
std::tuple<A> x; // #1
std::tuple<B> 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.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs