On 2017.04.10 at 13:20 -0600, Jeff Law wrote:
> 
> fold_convert can fail for certain types.  It can fail either by returning a
> error_mark_node or triggering a gcc_assert depending on the exact situation.
> 
> Both are problematical.  This patch checks that we can convert
> integer_zero_node to the proper type before calling fold_convert.
> 
> Bootstrapped and regression tested on x86_64.  Installing on the trunk.

I've fixed up the testcase:

FAIL: g++.dg/pr80374.C  -std=c++11 (test for excess errors)
FAIL: g++.dg/pr80374.C  -std=c++14 (test for excess errors)
FAIL: g++.dg/pr80374.C  -std=c++98 (test for excess errors)

Committed as obvious.

diff --git a/gcc/testsuite/g++.dg/pr80374.C b/gcc/testsuite/g++.dg/pr80374.C
index b02b65629aef..83f778be638a 100644
--- a/gcc/testsuite/g++.dg/pr80374.C
+++ b/gcc/testsuite/g++.dg/pr80374.C
@@ -1,3 +1,5 @@
+// { dg-do compile }
+// { dg-options "-O1 -std=c++11" }
 void a (const char *, const char *, int, const char *)
   __attribute__ ((__noreturn__));
 template <typename b, int>
@@ -11,7 +13,8 @@ catch (b d)
     if (d)
       a ("", "", 2, __PRETTY_FUNCTION__);
   }
-main ()
+void
+foo ()
 {
   using e = decltype (nullptr);
   c<volatile e, true> ();
-- 
Markus

Reply via email to