Re: C++ PATCH for c++/81073, constexpr and static var in statement-expression

2017-06-21 Thread Jason Merrill
On Wed, Jun 21, 2017 at 6:32 AM, Jakub Jelinek wrote: > The following patch fixes it by allowing that wording too on the line 10. > Is this ok for trunk or do you have some other preference? OK, thanks. Jason

Re: C++ PATCH for c++/81073, constexpr and static var in statement-expression

2017-06-21 Thread Jakub Jelinek
On Tue, Jun 20, 2017 at 09:45:10PM +0200, Andreas Schwab wrote: > On Jun 20 2017, Jason Merrill wrote: > > > On Tue, Jun 20, 2017 at 5:40 AM, Andreas Schwab wrote: > >> FAIL: g++.dg/cpp0x/constexpr-cast.C -std=c++11 (test for errors, line 10) > >> FAIL: g++.dg/cpp0x/constexpr-cast.C -std=c++1

Re: C++ PATCH for c++/81073, constexpr and static var in statement-expression

2017-06-20 Thread Andreas Schwab
On Jun 20 2017, Jason Merrill wrote: > On Tue, Jun 20, 2017 at 5:40 AM, Andreas Schwab wrote: >> FAIL: g++.dg/cpp0x/constexpr-cast.C -std=c++11 (test for errors, line 10) >> FAIL: g++.dg/cpp0x/constexpr-cast.C -std=c++11 (test for excess errors) >> FAIL: g++.dg/cpp0x/constexpr-cast.C -std=c+

Re: C++ PATCH for c++/81073, constexpr and static var in statement-expression

2017-06-20 Thread Jason Merrill
On Tue, Jun 20, 2017 at 5:40 AM, Andreas Schwab wrote: > FAIL: g++.dg/cpp0x/constexpr-cast.C -std=c++11 (test for errors, line 10) > FAIL: g++.dg/cpp0x/constexpr-cast.C -std=c++11 (test for excess errors) > FAIL: g++.dg/cpp0x/constexpr-cast.C -std=c++14 (test for errors, line 10) > FAIL: g++.

Re: C++ PATCH for c++/81073, constexpr and static var in statement-expression

2017-06-20 Thread Andreas Schwab
FAIL: g++.dg/cpp0x/constexpr-cast.C -std=c++11 (test for errors, line 10) FAIL: g++.dg/cpp0x/constexpr-cast.C -std=c++11 (test for excess errors) FAIL: g++.dg/cpp0x/constexpr-cast.C -std=c++14 (test for errors, line 10) FAIL: g++.dg/cpp0x/constexpr-cast.C -std=c++14 (test for excess errors)

C++ PATCH for c++/81073, constexpr and static var in statement-expression

2017-06-19 Thread Jason Merrill
The testcase successfully compiles, but then fails to link because we've optimized away the declaration of the variable. We catch this in potential_constant_expression_1, but this path wasn't calling it. Fixed on trunk by always calling that function, not just in templates. With that change, I ne