From: Paolo Carlini Date: Sun, 5 Mar 2017 17:13:16 +0000 (+0000) Subject: re PR c++/70266 (ICE on invalid code on x86_64-linux-gnu: unexpected expression ... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d8b4baeb45c2727156e6d14e1dee16e078c0a727;p=gcc.git re PR c++/70266 (ICE on invalid code on x86_64-linux-gnu: unexpected expression ‘foo’ of kind overload) /cp 2017-03-05 Paolo Carlini PR c++/70266 * except.c (build_must_not_throw_expr): Perform the implicit conversions on the condition. /testsuite 2017-03-05 Paolo Carlini PR c++/70266 * g++.dg/tm/pr70266.C: New. From-SVN: r245901 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b5587fdfab3..3d7eae90a27 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2017-03-05 Paolo Carlini + + PR c++/70266 + * except.c (build_must_not_throw_expr): Perform the implicit + conversions on the condition. + 2017-03-03 Jason Merrill * mangle.c (mangle_decl): Check -Wnoexcept-type instead of diff --git a/gcc/cp/except.c b/gcc/cp/except.c index bfc32908aec..45d00cc0fc9 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -268,6 +268,9 @@ build_must_not_throw_expr (tree body, tree cond) if (cond && !value_dependent_expression_p (cond)) { + cond = perform_implicit_conversion_flags (boolean_type_node, cond, + tf_warning_or_error, + LOOKUP_NORMAL); cond = cxx_constant_value (cond); if (integer_zerop (cond)) return body; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fcaacff3cc9..26bfb0ac170 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-03-05 Paolo Carlini + + PR c++/70266 + * g++.dg/tm/pr70266.C: New. + 2017-03-05 Andre Vehreschild Alessandro Fanfarillo diff --git a/gcc/testsuite/g++.dg/tm/pr70266.C b/gcc/testsuite/g++.dg/tm/pr70266.C new file mode 100644 index 00000000000..6f20afb51c6 --- /dev/null +++ b/gcc/testsuite/g++.dg/tm/pr70266.C @@ -0,0 +1,8 @@ +// { dg-do compile { target c++11 } } +// { dg-options "-fgnu-tm" } + +template < typename T > +int foo (int x, T t) +{ + return __transaction_atomic noexcept (foo) (1); // { dg-error "cannot resolve" } +}