https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80059
Paolo Carlini <paolo.carlini at oracle dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paolo.carlini at oracle dot com --- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> --- Sorry about the regression. Marek, what about something like: Index: except.c =================================================================== --- except.c (revision 246216) +++ except.c (working copy) @@ -271,6 +271,8 @@ build_must_not_throw_expr (tree body, tree cond) cond = perform_implicit_conversion_flags (boolean_type_node, cond, tf_warning_or_error, LOOKUP_NORMAL); + if (processing_template_decl) + cond = fold_non_dependent_expr (cond); cond = cxx_constant_value (cond); if (integer_zerop (cond)) return body; certainly works fine for the testcases at issue and also for variants like: template<typename T> int foo(T b) { return __transaction_atomic noexcept(b) (0); } void bar() { foo(true); }