From 39d1184ba813eaabd366d9e8cdd7d19f4fdbd9e8 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Mon, 10 Jun 2019 16:55:36 +0100 Subject: [PATCH] PR other/90695 reduce testcase to remove library dependency This reproduces the original ICE fixed by r178857 (tested at r178852 and r178860), without depending on a libstdc++ header that keeps changing. The number of errors differs between C++14 and C++17 modes, so the fixed test uses dg-excess-errors to match any number of them. The precise errors aren't what's being tested for here anyway, the point of the test is to verify the ICE in PR 50391 is fixed. PR other/90695 * g++.dg/cpp0x/noexcept15.C: Remove dependency on library header. From-SVN: r272121 --- gcc/testsuite/ChangeLog | 5 ++++ gcc/testsuite/g++.dg/cpp0x/noexcept15.C | 40 +++++++++++++++++++++++-- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 191fec2f7b0..ede0ec50a31 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-06-10 Jonathan Wakely + + PR other/90695 + * g++.dg/cpp0x/noexcept15.C: Remove dependency on library header. + 2019-06-10 Jakub Jelinek * c-c++-common/gomp/scan-1.c: New test. diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept15.C b/gcc/testsuite/g++.dg/cpp0x/noexcept15.C index 5cbbea8a91a..6c6eef68915 100644 --- a/gcc/testsuite/g++.dg/cpp0x/noexcept15.C +++ b/gcc/testsuite/g++.dg/cpp0x/noexcept15.C @@ -1,12 +1,46 @@ // PR c++/50391 // { dg-do compile { target c++11 } } -#include +namespace std +{ + template + struct integral_constant + { static constexpr T value = Val; }; + + template + struct is_abstract + : integral_constant + { }; + + template::value> + struct is_destructible + : integral_constant + { }; + + template + struct is_destructible + : integral_constant + { }; + + template + struct is_nothrow_move_constructible + : is_destructible + { }; + + template + struct decay + { typedef T type; }; + + template + struct decay + { typedef T type; }; + +} // std template struct single { - Tp elem; // { dg-error "incomplete type" } + Tp elem; constexpr single(const Tp& e) : elem(e) { } @@ -30,3 +64,5 @@ foo(Blob *b) { make_single(*b); } + +// { dg-excess-errors "incomplete type|not a member" } -- 2.30.2