From 44ff8022b779028a5161ed69f81a34bc832e1f72 Mon Sep 17 00:00:00 2001 From: jeff200902 Date: Fri, 30 Oct 2020 14:35:26 +0800 Subject: [PATCH] fixed c++/81589 add c++/81589 patch --- fix-trivially_constructible-PR81589.patch | 42 +++++++++++++++++++++++ gcc.spec | 8 +++-- 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 fix-trivially_constructible-PR81589.patch diff --git a/fix-trivially_constructible-PR81589.patch b/fix-trivially_constructible-PR81589.patch new file mode 100644 index 0000000..15bb46e --- /dev/null +++ b/fix-trivially_constructible-PR81589.patch @@ -0,0 +1,42 @@ +From 57b9683f0ce55a410c567fcb2dc365a2cc848d6a Mon Sep 17 00:00:00 2001 +From: jason +Date: Mon, 26 Feb 2018 06:09:07 +0000 +Subject: [PATCH] PR c++/81589 - error with is_trivially_constructible. + + * method.c (constructible_expr): Set cp_unevaluated. + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@257981 138bc75d-0d04-0410-961f-82ee72b054a4 +--- + gcc/cp/method.c | 1 + + gcc/testsuite/g++.dg/ext/is_trivially_constructible6.C | 10 ++++++++++ + 2 files changed, 11 insertions(+) + create mode 100644 gcc/testsuite/g++.dg/ext/is_trivially_constructible6.C + +diff --git a/gcc/cp/method.c b/gcc/cp/method.c +index 59ad43f73fee..a2d4c071efa3 100644 +--- a/gcc/cp/method.c ++++ b/gcc/cp/method.c +@@ -1165,6 +1165,7 @@ constructible_expr (tree to, tree from) + { + tree ctype = to; + vec *args = NULL; ++ cp_unevaluated cp_uneval_guard; + if (TREE_CODE (to) != REFERENCE_TYPE) + to = cp_build_reference_type (to, /*rval*/false); + tree ob = build_stub_object (to); +diff --git a/gcc/testsuite/g++.dg/ext/is_trivially_constructible6.C b/gcc/testsuite/g++.dg/ext/is_trivially_constructible6.C +new file mode 100644 +index 000000000000..10a8dfbb8f0b +--- /dev/null ++++ b/gcc/testsuite/g++.dg/ext/is_trivially_constructible6.C +@@ -0,0 +1,10 @@ ++// PR c++/81589 ++ ++template ++struct z { ++ z() { ++ k::error; ++ } ++}; ++ ++int x = __is_trivially_constructible(z); diff --git a/gcc.spec b/gcc.spec index d4332c0..25aefc1 100644 --- a/gcc.spec +++ b/gcc.spec @@ -36,7 +36,7 @@ Summary: Various compilers (C, C++, Objective-C, Java, ...) Name: gcc Version: 7.3.0 -Release: %{gcc_release}.34 +Release: %{gcc_release}.35 License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD Group: Development/Languages #Source0: hcc-aarch64-linux-release.tar.bz2 @@ -84,7 +84,7 @@ Patch29: Big-endian-union-bitfield-bugfix.patch Patch31: fstack-clash-protection.patch Patch34: mark-pattern-as-clobbering-CC-REGNUM.patch Patch35: turn-on-funwind-tables-by-default.patch - +Patch36: fix-trivially_constructible-PR81589.patch #AutoReqProv: off AutoReq: true @@ -508,6 +508,7 @@ package or when debugging this package. %patch31 -p1 %patch34 -p1 %patch35 -p1 +%patch36 -p1 %if 0%{?_enable_debug_packages} cat > split-debuginfo.sh <<\EOF @@ -3140,6 +3141,9 @@ fi %changelog +* Wed Oct 28 2020 jeff200902 - 7.3.0-20190804.35 +- fixed PR c++/81589, error with is_trivially_constructible. + * Tue Aug 21 2020 openEuler Buildteam - 7.3.0-20190804.34 - Type:rebuild - ID:NA -- Gitee