[Bug libstdc++/78442] New: [variant] std::get<...>(Variant) is not constexpr.
eric at efcs dot ca
gcc-bugzilla@gcc.gnu.org
Mon Nov 21 04:42:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78442
Bug ID: 78442
Summary: [variant] std::get<...>(Variant) is not constexpr.
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: eric at efcs dot ca
Target Milestone: ---
See the below reproducer:
#include <variant>
constexpr bool test() {
std::variant<int, void*> v(42);
auto const& cv = v;
static_assert(std::get<0>(v) == 42, "");
static_assert(std::get<0>(cv) == 42, "");
return true;
}
static_assert(test(), "");
int main() {}
More information about the Gcc-bugs
mailing list