[Bug libstdc++/78442] [variant] std::get<...>(Variant) is not constexpr.

2016-12-06 Thread timshen at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78442

Tim Shen  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Tim Shen  ---
Fixed by r243293.

[Bug libstdc++/78442] [variant] std::get<...>(Variant) is not constexpr.

2016-12-03 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78442

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-12-03
   Assignee|unassigned at gcc dot gnu.org  |timshen at gcc dot 
gnu.org
   Target Milestone|--- |7.0
 Ever confirmed|0   |1

[Bug libstdc++/78442] [variant] std::get<...>(Variant) is not constexpr.

2016-11-21 Thread eric at efcs dot ca
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78442

--- Comment #2 from Eric Fiselier  ---
I'm sorry your right. That's a garbage reproducer. Here's an actual one:

#include 
#include 

constexpr bool test_tuple() {
 std::tuple t(42);
 return std::get<0>(t) == 42;
}
static_assert(test_tuple(), ""); // OK

constexpr bool test() {
  std::variant v(42);
  auto const& cv = v;
  return std::get<0>(v) == 42 &&
 std::get<0>(cv) == 42; 

}
static_assert(test(), "");

[Bug libstdc++/78442] [variant] std::get<...>(Variant) is not constexpr.

2016-11-21 Thread timshen at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78442

Tim Shen  changed:

   What|Removed |Added

 CC||timshen at gcc dot gnu.org

--- Comment #1 from Tim Shen  ---
I'm not sure whether the test case is valid.

A similar test case like this for  doesn't compile:

#include 

constexpr bool test() {
  std::tuple v{42, nullptr};
  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() {}