This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/54968] New: spurious constexpr error, 20_util/tuple/comparison_operators/35480_neg.cc


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54968

             Bug #: 54968
           Summary: spurious constexpr error,
                    20_util/tuple/comparison_operators/35480_neg.cc
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: bkoz@gcc.gnu.org


Created attachment 28477
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28477
pre-processed test

While finishing up the latest constexpr hacking, I noticed that tuple's
relational operators now give a bogus excess error:

FAIL: 20_util/tuple/comparison_operators/35480_neg.cc (test for excess errors)
Excess errors:
/mnt/share/bld/gcc.git-trunk/x86_64-unknown-linux-gnu/libstdc++-v3/include/tuple:824:5:
error: body of constexpr function 'constexpr bool std::operator<(const
std::tuple<_Elements ...>&, const std::tuple<_Elements ...>&) [with _TElements
= {int}; _UElements = {int, int}]' not a return-statement
/mnt/share/bld/gcc.git-trunk/x86_64-unknown-linux-gnu/libstdc++-v3/include/tuple:813:5:
error: body of constexpr function 'constexpr bool std::operator==(const
std::tuple<_Elements ...>&, const std::tuple<_Elements ...>&) [with _TElements
= {int}; _UElements = {int, int}]' not a return-statement


but this seems unlikely, given:

  template<typename... _TElements, typename... _UElements>
    constexpr bool
    operator==(const tuple<_TElements...>& __t,
           const tuple<_UElements...>& __u)
    {
      typedef tuple<_TElements...> _Tp;
      typedef tuple<_UElements...> _Up;
      return (__tuple_compare<tuple_size<_Tp>::value - tuple_size<_Up>::value,
          0, tuple_size<_Tp>::value, _Tp, _Up>::__eq(__t, __u));
    }

and more importantly, the passing of the positive test here:
libstdc++-v3/testsuite/20_util/tuple/comparison_operators/constexpr.cc

Reasonable people may disagree, and hey, it's late.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]