except.c (build_noexcept_spec): Use build_converted_constant_bool_expr instead of...
authorMarek Polacek <polacek@redhat.com>
Fri, 12 Apr 2019 15:26:16 +0000 (15:26 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Fri, 12 Apr 2019 15:26:16 +0000 (15:26 +0000)
* 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

gcc/cp/ChangeLog
gcc/cp/except.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/noexcept30.C
gcc/testsuite/g++.dg/cpp0x/pr86397-1.C
gcc/testsuite/g++.dg/cpp0x/pr86397-2.C

index 1c0f7446c91f264390e958a03f4034e90a84b361..9a126226fe5bd07bd999634a5d2fb417e3abcd66 100644 (file)
@@ -1,3 +1,8 @@
+2019-04-12  Marek Polacek  <polacek@redhat.com>
+
+       * except.c (build_noexcept_spec): Use build_converted_constant_bool_expr
+       instead of perform_implicit_conversion_flags.
+
 2019-04-11  Jakub Jelinek  <jakub@redhat.com>
 
        PR translation/90035
index 40e973fad66b4e7559d2d1c1847554581215b50c..25ab86995896959777d6d094a1e6c8cf7a4a205a 100644 (file)
@@ -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);
     }
index eba43e597dc5790b633fcdebc872603b122001a9..f20f45d44a2804d0fca7ad527fa4567022fc4858 100644 (file)
@@ -1,3 +1,9 @@
+2019-04-12  Marek Polacek  <polacek@redhat.com>
+
+       * 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  <matthew.malcomson@arm.com>
 
        * g++.target/arm/arm.exp: Change format of default prune regex.
index 8c7ff2aad45006cd7afd6a55fff02096689870b6..6a9f782109223dddde36191af49361b6062099bf 100644 (file)
@@ -5,7 +5,7 @@
 template<typename A>
 struct F {
   template<typename B>
-  void f() noexcept(&F::template f<B>) {} // { dg-error "exception specification" }
+  void f() noexcept(&F::template f<B>) {} // { dg-error "exception specification|convert" }
 };
 
 int main () {
index a0123cba0da7364febddc2b21b52287f14f701c9..c6cfc1b55615e342d3e85078108711815fd1dd5d 100644 (file)
@@ -1,5 +1,5 @@
 // { dg-do compile { target c++11 } }
 // { dg-options "-fdelete-null-pointer-checks" }
 void e();
-template <bool> void f(int() noexcept(e)) {}
-template void f<false>(int()); // { dg-error "does not match" "" { target c++17 } }
+template <bool> void f(int() noexcept(e)) {} // { dg-error "convert" }
+template void f<false>(int());
index 8e4956bcf6ca443246a4256f845074cfd05235a8..54aefdb091609fd318730aa04cc9f017a65a60dc 100644 (file)
@@ -1,5 +1,5 @@
 // { dg-do compile { target c++11 } }
 // { dg-options "-fdelete-null-pointer-checks" }
 void e();
-template <bool> void f(int() noexcept(e)) {}
-template void f<false>(int() noexcept);
+template <bool> void f(int() noexcept(e)) {} // { dg-error "convert" }
+template void f<false>(int() noexcept); // { dg-error "does not match any template declaration" "" { target c++17 } }