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++/64647] [5 Regression] [C++14] std::__max_element contains code not allowed in constexpr function


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

Ville Voutilainen <ville.voutilainen at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at redhat dot com
          Component|libstdc++                   |c++

--- Comment #1 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
This code

template<typename T>
constexpr T foo(T t)
{
  T tt = t;
  ++tt;
  return tt;
}

struct X
{
  X() { }
  X& operator++() { return *this; }
};

int main()
{
  X x;
  foo(x);
}

is accepted by clang but rejected by gcc. Moving to front-end.


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