[llvm-bugs] [Bug 41843] New: std::is_base_of should give correct result for incomplete unions
via llvm-bugs
llvm-bugs at lists.llvm.org
Sat May 11 09:03:19 PDT 2019
https://bugs.llvm.org/show_bug.cgi?id=41843
Bug ID: 41843
Summary: std::is_base_of should give correct result for
incomplete unions
Product: libc++
Version: 8.0
Hardware: Macintosh
OS: All
Status: NEW
Severity: normal
Priority: P
Component: All Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: alisdairm at me.com
CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com
Created attachment 21928
--> https://bugs.llvm.org/attachment.cgi?id=21928&action=edit
Source for failing test
C++20 clarifies the expectation for detecting traits that cannot determine a
result due to an incomplete class. However, is_base_of is expected to
recognize that unions can never have a base class, nor ever be a base class,
and so give the correct result - per the current working draft.
The following code is expected to compile without triggering a static assert.
For the current clang/libc++, it fails to compile the middle two heterogeneous
assertions:
#include <type_traits>
struct Incomplete;
union Uncomplete;
int main() {
static_assert( std::is_base_of_v<Incomplete, Incomplete>);
static_assert(!std::is_base_of_v<Incomplete, Uncomplete>); // fails to
compile
static_assert(!std::is_base_of_v<Uncomplete, Incomplete>); // fails to
compile
static_assert(!std::is_base_of_v<Uncomplete, Uncomplete>);
}
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190511/6820b25e/attachment.html>
More information about the llvm-bugs
mailing list