https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70139

--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Reduced testcase from 70145

namespace std /* simplified std::pair from <utility> */
{
  template<class _T1, class _T2>
    struct pair
    {
      typedef _T1 first_type;
      typedef _T2 second_type;

      _T1 first;
      _T2 second;

      constexpr pair()
      : first(), second() { }


      constexpr pair(const _T1& __a, const _T2& __b)
      : first(__a), second(__b) { }
 };
}

class Test
{
public:
  constexpr Test(const bool b): b_(b) {}
  constexpr bool operator!=(const Test rh) const
  {
    return b_ != rh.b_;
  }
private:
   bool b_;
};

constexpr static std::pair<Test, Test*> tests[] =
{
  { Test(true), nullptr },
  { Test(false), nullptr }
};

int main()
{
  return tests[0].first != tests[1].first;
}

Reply via email to