diff options
author | Marek Polacek <mpolacek@gcc.gnu.org> | 2019-06-21 20:19:24 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2019-06-21 20:19:24 +0000 |
commit | 4c60db9a7b033fc58a93fd93eb36a4f0bb311b63 (patch) | |
tree | 32f0ebc475ff899a3bddcfb9f97c178b8c679703 /gcc/cp | |
parent | c27d68ee6d1a15cc12ef20458342202c6c9d4203 (diff) | |
download | gcc-4c60db9a7b033fc58a93fd93eb36a4f0bb311b63.zip gcc-4c60db9a7b033fc58a93fd93eb36a4f0bb311b63.tar.gz gcc-4c60db9a7b033fc58a93fd93eb36a4f0bb311b63.tar.bz2 |
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
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/cp/except.c | 4 |
2 files changed, 12 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c958318..0afd0e6 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,12 @@ +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> PR c++/90950 diff --git a/gcc/cp/except.c b/gcc/cp/except.c index 892d520..71f5d60 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -1285,8 +1285,10 @@ build_noexcept_spec (tree expr, tsubst_flags_t complain) if (TREE_CODE (expr) != DEFERRED_NOEXCEPT && !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 = instantiate_non_dependent_expr (expr); expr = cxx_constant_value (expr); } if (TREE_CODE (expr) == INTEGER_CST) |