From d8b4baeb45c2727156e6d14e1dee16e078c0a727 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Sun, 5 Mar 2017 17:13:16 +0000 Subject: [PATCH] =?utf8?q?re=20PR=20c++/70266=20(ICE=20on=20invalid=20code?= =?utf8?q?=20on=20x86=5F64-linux-gnu:=20unexpected=20expression=20?= =?utf8?q?=E2=80=98foo=E2=80=99=20of=20kind=20overload)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit /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 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/except.c | 3 +++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/tm/pr70266.C | 8 ++++++++ 4 files changed, 22 insertions(+) create mode 100644 gcc/testsuite/g++.dg/tm/pr70266.C 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" } +} -- 2.30.2