Commit 92377255 by Marek Polacek Committed by Marek Polacek

PR c++/80059 - ICE with noexcept and __transaction_atomic

	PR c++/80059 - ICE with noexcept and __transaction_atomic
	* except.c (build_must_not_throw_expr): Call
	instantiate_non_dependent_expr_sfinae.

	* g++.dg/tm/pr80059-2.C: New test.
	* g++.dg/tm/pr80059.C: New test.

Co-Authored-By: Paolo Carlini <paolo.carlini@oracle.com>

From-SVN: r246279
parent a74560eb
2017-03-20 Marek Polacek <polacek@redhat.com>
Paolo Carlini <paolo.carlini@oracle.com>
PR c++/80059 - ICE with noexcept and __transaction_atomic
* except.c (build_must_not_throw_expr): Call
instantiate_non_dependent_expr_sfinae.
2017-03-19 Jason Merrill <jason@redhat.com>
PR c++/80084 - wrong C++17 decomposition by reference of parameter.
......
......@@ -271,6 +271,7 @@ build_must_not_throw_expr (tree body, tree cond)
cond = perform_implicit_conversion_flags (boolean_type_node, cond,
tf_warning_or_error,
LOOKUP_NORMAL);
cond = instantiate_non_dependent_expr (cond);
cond = cxx_constant_value (cond);
if (integer_zerop (cond))
return body;
......
2017-03-20 Marek Polacek <polacek@redhat.com>
Paolo Carlini <paolo.carlini@oracle.com>
PR c++/80059 - ICE with noexcept and __transaction_atomic
* g++.dg/tm/pr80059-2.C: New test.
* g++.dg/tm/pr80059.C: New test.
2017-03-20 Martin Liska <mliska@suse.cz>
PR middle-end/79753
......
// PR c++/80059
// { dg-do compile { target c++11 } }
// { dg-options "-fgnu-tm" }
template<typename T> int foo(T b)
{
return __transaction_atomic noexcept(b) (0); // { dg-error "is not a constant expression" }
}
void bar()
{
foo(true);
}
// PR c++/80059
// { dg-do compile { target c++11 } }
// { dg-options "-fgnu-tm" }
template<typename> int foo(bool b)
{
return __transaction_atomic noexcept(b) (0); // { dg-error "is not a constant expression" }
}
void bar()
{
foo<int>(true);
}
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