From: Marek Polacek Date: Fri, 12 Apr 2019 15:26:16 +0000 (+0000) Subject: except.c (build_noexcept_spec): Use build_converted_constant_bool_expr instead of... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cc3bae3dc2819726e3d3903937e65f4f8d4f2fd5;p=gcc.git except.c (build_noexcept_spec): Use build_converted_constant_bool_expr instead of perform_implicit_conversion_flags. * except.c (build_noexcept_spec): Use build_converted_constant_bool_expr instead of perform_implicit_conversion_flags. * g++.dg/cpp0x/noexcept30.C: Tweak dg-error. * g++.dg/cpp0x/pr86397-1.C: Likewise. * g++.dg/cpp0x/pr86397-2.C: Likewise. From-SVN: r270319 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1c0f7446c91..9a126226fe5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2019-04-12 Marek Polacek + + * except.c (build_noexcept_spec): Use build_converted_constant_bool_expr + instead of perform_implicit_conversion_flags. + 2019-04-11 Jakub Jelinek PR translation/90035 diff --git a/gcc/cp/except.c b/gcc/cp/except.c index 40e973fad66..25ab8699589 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -1285,9 +1285,7 @@ build_noexcept_spec (tree expr, tsubst_flags_t complain) if (TREE_CODE (expr) != DEFERRED_NOEXCEPT && !value_dependent_expression_p (expr)) { - expr = perform_implicit_conversion_flags (boolean_type_node, expr, - complain, - LOOKUP_NORMAL); + expr = build_converted_constant_bool_expr (expr, complain); expr = instantiate_non_dependent_expr (expr); expr = cxx_constant_value (expr); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index eba43e597dc..f20f45d44a2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2019-04-12 Marek Polacek + + * g++.dg/cpp0x/noexcept30.C: Tweak dg-error. + * g++.dg/cpp0x/pr86397-1.C: Likewise. + * g++.dg/cpp0x/pr86397-2.C: Likewise. + 2019-04-12 Matthew Malcomson * g++.target/arm/arm.exp: Change format of default prune regex. diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept30.C b/gcc/testsuite/g++.dg/cpp0x/noexcept30.C index 8c7ff2aad45..6a9f7821092 100644 --- a/gcc/testsuite/g++.dg/cpp0x/noexcept30.C +++ b/gcc/testsuite/g++.dg/cpp0x/noexcept30.C @@ -5,7 +5,7 @@ template struct F { template - void f() noexcept(&F::template f) {} // { dg-error "exception specification" } + void f() noexcept(&F::template f) {} // { dg-error "exception specification|convert" } }; int main () { diff --git a/gcc/testsuite/g++.dg/cpp0x/pr86397-1.C b/gcc/testsuite/g++.dg/cpp0x/pr86397-1.C index a0123cba0da..c6cfc1b5561 100644 --- a/gcc/testsuite/g++.dg/cpp0x/pr86397-1.C +++ b/gcc/testsuite/g++.dg/cpp0x/pr86397-1.C @@ -1,5 +1,5 @@ // { dg-do compile { target c++11 } } // { dg-options "-fdelete-null-pointer-checks" } void e(); -template void f(int() noexcept(e)) {} -template void f(int()); // { dg-error "does not match" "" { target c++17 } } +template void f(int() noexcept(e)) {} // { dg-error "convert" } +template void f(int()); diff --git a/gcc/testsuite/g++.dg/cpp0x/pr86397-2.C b/gcc/testsuite/g++.dg/cpp0x/pr86397-2.C index 8e4956bcf6c..54aefdb0916 100644 --- a/gcc/testsuite/g++.dg/cpp0x/pr86397-2.C +++ b/gcc/testsuite/g++.dg/cpp0x/pr86397-2.C @@ -1,5 +1,5 @@ // { dg-do compile { target c++11 } } // { dg-options "-fdelete-null-pointer-checks" } void e(); -template void f(int() noexcept(e)) {} -template void f(int() noexcept); +template void f(int() noexcept(e)) {} // { dg-error "convert" } +template void f(int() noexcept); // { dg-error "does not match any template declaration" "" { target c++17 } }