Re: C++ PATCH to fix bogus error with constexpr and empty class (PR c++/81933)

2018-01-22 Thread Jason Merrill
OK, thanks. On Mon, Jan 22, 2018 at 10:44 AM, Marek Polacek wrote: > On Mon, Jan 22, 2018 at 09:40:50AM -0500, Jason Merrill wrote: >> This seems like a workaround rather than a fix; we should fix >> split_nonconstant_init to work properly rather than override it. >> Specifically, it seems odd to

Re: C++ PATCH to fix bogus error with constexpr and empty class (PR c++/81933)

2018-01-22 Thread Marek Polacek
On Mon, Jan 22, 2018 at 09:40:50AM -0500, Jason Merrill wrote: > This seems like a workaround rather than a fix; we should fix > split_nonconstant_init to work properly rather than override it. > Specifically, it seems odd to return true if num_elts is 0; we > shouldn't override DECL_INITIAL if we

Re: C++ PATCH to fix bogus error with constexpr and empty class (PR c++/81933)

2018-01-22 Thread Jason Merrill
On Thu, Jan 18, 2018 at 5:39 PM, Marek Polacek wrote: > The problem in this PR is that we get > error: constexpr call flows off the end of the function > for a valid testcase, but not in C++17 mode. That's because in C++17 we > execute: > > 4321 if (cxx_dialect >= cxx17 && !BINFO_VIRTUAL_P