From: Marek Polacek Date: Tue, 3 Jul 2018 16:38:16 +0000 (+0000) Subject: re PR c++/86201 (ICE: Error reporting routines re-entered) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=44b0c9aedb07df1c8c9c26f5a7146db38fee42e0;p=gcc.git 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index de313ae2ff5..e4202e161ba 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2018-07-03 Marek Polacek + + PR c++/86201 + * typeck.c (cp_build_binary_op): Check c_inhibit_evaluation_warnings. + 2018-07-03 Jason Merrill PR c++/86378 - functional cast in noexcept-specifier. diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 3a4f1cdf479..ea4ce9649cd 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -4734,6 +4734,7 @@ cp_build_binary_op (location_t location, if (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE) goto vector_compare; if ((complain & tf_warning) + && c_inhibit_evaluation_warnings == 0 && (FLOAT_TYPE_P (type0) || FLOAT_TYPE_P (type1))) warning (OPT_Wfloat_equal, "comparing floating point with == or != is unsafe"); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 333096287be..2afad58666b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-07-03 Marek Polacek + + PR c++/86201 + * g++.dg/diagnostic/pr86201.C: New test. + 2018-07-03 Richard Sandiford PR tree-optimization/85694 diff --git a/gcc/testsuite/g++.dg/diagnostic/pr86201.C b/gcc/testsuite/g++.dg/diagnostic/pr86201.C new file mode 100644 index 00000000000..e7019c22d95 --- /dev/null +++ b/gcc/testsuite/g++.dg/diagnostic/pr86201.C @@ -0,0 +1,12 @@ +// PR c++/86201 +// { dg-do compile { target c++11 } } + +template +auto fn1 (V&& v) -> decltype(U(v)) +{ + return; // { dg-error "return-statement with no value" } +} +void fn2 () +{ + fn1(1.0); +}