Commit 44b0c9ae by Marek Polacek Committed by Marek Polacek

re PR c++/86201 (ICE: Error reporting routines re-entered)

	PR c++/86201
	* typeck.c (cp_build_binary_op): Check c_inhibit_evaluation_warnings.

	* g++.dg/diagnostic/pr86201.C: New test.

From-SVN: r262353
parent 315aadc8
2018-07-03 Marek Polacek <polacek@redhat.com>
PR c++/86201
* typeck.c (cp_build_binary_op): Check c_inhibit_evaluation_warnings.
2018-07-03 Jason Merrill <jason@redhat.com> 2018-07-03 Jason Merrill <jason@redhat.com>
PR c++/86378 - functional cast in noexcept-specifier. PR c++/86378 - functional cast in noexcept-specifier.
......
...@@ -4734,6 +4734,7 @@ cp_build_binary_op (location_t location, ...@@ -4734,6 +4734,7 @@ cp_build_binary_op (location_t location,
if (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE) if (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE)
goto vector_compare; goto vector_compare;
if ((complain & tf_warning) if ((complain & tf_warning)
&& c_inhibit_evaluation_warnings == 0
&& (FLOAT_TYPE_P (type0) || FLOAT_TYPE_P (type1))) && (FLOAT_TYPE_P (type0) || FLOAT_TYPE_P (type1)))
warning (OPT_Wfloat_equal, warning (OPT_Wfloat_equal,
"comparing floating point with == or != is unsafe"); "comparing floating point with == or != is unsafe");
......
2018-07-03 Marek Polacek <polacek@redhat.com>
PR c++/86201
* g++.dg/diagnostic/pr86201.C: New test.
2018-07-03 Richard Sandiford <richard.sandiford@arm.com> 2018-07-03 Richard Sandiford <richard.sandiford@arm.com>
PR tree-optimization/85694 PR tree-optimization/85694
......
// PR c++/86201
// { dg-do compile { target c++11 } }
template <class U, class V>
auto fn1 (V&& v) -> decltype(U(v))
{
return; // { dg-error "return-statement with no value" }
}
void fn2 ()
{
fn1<bool>(1.0);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment