Commit 4c60db9a by Marek Polacek

PR c++/90490 - fix decltype issues in noexcept-specifier.

	* except.c (build_noexcept_spec): Call
	instantiate_non_dependent_expr_sfinae before
	build_converted_constant_expr instead of calling
	instantiate_non_dependent_expr after it.  Add
	processing_template_decl_sentinel.

	* g++.dg/cpp0x/noexcept43.C: New test.
	* g++.dg/cpp0x/noexcept44.C: New test.

From-SVN: r272568
parent c27d68ee
2019-06-21 Marek Polacek <polacek@redhat.com>
PR c++/90490 - fix decltype issues in noexcept-specifier.
* except.c (build_noexcept_spec): Call
instantiate_non_dependent_expr_sfinae before
build_converted_constant_expr instead of calling
instantiate_non_dependent_expr after it. Add
processing_template_decl_sentinel.
2019-06-21 Jakub Jelinek <jakub@redhat.com> 2019-06-21 Jakub Jelinek <jakub@redhat.com>
PR c++/90950 PR c++/90950
......
...@@ -1285,8 +1285,10 @@ build_noexcept_spec (tree expr, tsubst_flags_t complain) ...@@ -1285,8 +1285,10 @@ build_noexcept_spec (tree expr, tsubst_flags_t complain)
if (TREE_CODE (expr) != DEFERRED_NOEXCEPT if (TREE_CODE (expr) != DEFERRED_NOEXCEPT
&& !value_dependent_expression_p (expr)) && !value_dependent_expression_p (expr))
{ {
expr = instantiate_non_dependent_expr_sfinae (expr, complain);
/* Don't let convert_like_real create more template codes. */
processing_template_decl_sentinel s;
expr = build_converted_constant_bool_expr (expr, complain); expr = build_converted_constant_bool_expr (expr, complain);
expr = instantiate_non_dependent_expr (expr);
expr = cxx_constant_value (expr); expr = cxx_constant_value (expr);
} }
if (TREE_CODE (expr) == INTEGER_CST) if (TREE_CODE (expr) == INTEGER_CST)
......
2019-06-21 Marek Polacek <polacek@redhat.com>
PR c++/90490 - fix decltype issues in noexcept-specifier.
* g++.dg/cpp0x/noexcept43.C: New test.
* g++.dg/cpp0x/noexcept44.C: New test.
2019-06-21 Matthew Beliveau <mbelivea@redhat.com> 2019-06-21 Matthew Beliveau <mbelivea@redhat.com>
PR c++/90875 - added -Wswitch-outside-range option PR c++/90875 - added -Wswitch-outside-range option
...@@ -13,7 +19,7 @@ ...@@ -13,7 +19,7 @@
2019-06-21 Jeff Law <law@redhat.com> 2019-06-21 Jeff Law <law@redhat.com>
PR tree-optimization/90949 PR tree-optimization/90949
* gcc.c-torture/execute/pr90949.c: New test. * gcc.c-torture/execute/pr90949.c: New test.
2019-06-21 Marek Polacek <polacek@redhat.com> 2019-06-21 Marek Polacek <polacek@redhat.com>
......
// PR c++/90490
// { dg-do compile { target c++11 } }
struct R { constexpr operator bool() { return false;} };
template <typename>
struct S {
void g() noexcept(decltype(R{ }) { }) {
}
};
// PR c++/90490
// { dg-do compile { target c++11 } }
template <typename>
struct S {
void g() noexcept(decltype(int{ }) { }) {
}
};
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