diff --git a/Backport-fix-contexpr-list-initialized-member.patch b/Backport-fix-contexpr-list-initialized-member.patch new file mode 100644 index 0000000000000000000000000000000000000000..a0e8102a828432a385c3a1f09723a1e36f7dd927 --- /dev/null +++ b/Backport-fix-contexpr-list-initialized-member.patch @@ -0,0 +1,72 @@ +From fceecb5f37d65944c822bd172cde89e670669d49 Mon Sep 17 00:00:00 2001 +From: Jason Merrill +Date: Mon, 29 Jan 2018 15:58:36 -0500 +Subject: [PATCH] PR c++/82461 - constexpr list-initialized member + + * constexpr.c (potential_constant_expression_1): Check + TARGET_EXPR_DIRECT_INIT_P. + +From-SVN: r257164 +--- + gcc/cp/ChangeLog | 5 +++++ + gcc/cp/constexpr.c | 3 ++- + gcc/testsuite/g++.dg/cpp0x/constexpr-list2.C | 20 ++++++++++++++++++++ + 3 files changed, 27 insertions(+), 1 deletion(-) + create mode 100644 gcc/testsuite/g++.dg/cpp0x/constexpr-list2.C + +diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog +index 6aa0075b5..801d8cee3 100644 +--- a/gcc/cp/ChangeLog ++++ b/gcc/cp/ChangeLog +@@ -1,3 +1,8 @@ ++2018-01-29 Jason Merrill ++ PR c++/82461 - constexpr list-initialized member ++ * constexpr.c (potential_constant_expression_1): Check ++ TARGET_EXPR_DIRECT_INIT_P. ++ + 2018-02-15 Jason Merrill + + PR c++/83227 - C++17 ICE with init-list derived-to-base conversion. +diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c +index 9082230b9..0d294ca49 100644 +--- a/gcc/cp/constexpr.c ++++ b/gcc/cp/constexpr.c +@@ -5627,7 +5627,8 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, + return RECUR (TREE_OPERAND (t, 1), want_rval); + + case TARGET_EXPR: +- if (!literal_type_p (TREE_TYPE (t))) ++ if (!TARGET_EXPR_DIRECT_INIT_P (t) ++ && !literal_type_p (TREE_TYPE (t))) + { + if (flags & tf_error) + { +diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-list2.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-list2.C +new file mode 100644 +index 000000000..780a64dbb +--- /dev/null ++++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-list2.C +@@ -0,0 +1,20 @@ ++// PR c++/82461 ++// { dg-do compile { target c++11 } } ++ ++class A { ++private: ++public: ++ constexpr A() {} ++ ~A() {} ++}; ++ ++class B { ++private: ++ A a; ++public: ++ constexpr B() : a{} {} ++// works ++// constexpr B() : a() {} ++ ++ ~B() {} ++}; +-- +2.27.0 + diff --git a/gcc.spec b/gcc.spec index 61b334b7d08589464c460024da8f2628e84a36a9..ec0dada1b7ecd257cf16ef36e3218e7f73f16958 100644 --- a/gcc.spec +++ b/gcc.spec @@ -41,7 +41,7 @@ Version: 7.3.0 # number 2020033101 meaning the openEuler 20.03 release date plus 01 to # replace DATE and will never change it in the future. %global openEulerDATE 2020033101 -Release: %{openEulerDATE}.58 +Release: %{openEulerDATE}.59 License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD Group: Development/Languages #Source0: hcc-aarch64-linux-release.tar.bz2 @@ -106,7 +106,7 @@ Patch56: Backport-Learn-GIMPLE-pretty-printer-to-produce-nice.patch Patch57: Backport-AArch64-Fix-longbranch-test.patch Patch58: Backport-re-PR-tree-optimization-84552-Compile-time-.patch Patch59: delete-auto-bolt-feature.patch - +Patch60: Backport-fix-contexpr-list-initialized-member.patch #AutoReqProv: off AutoReq: true @@ -3338,6 +3338,9 @@ fi %changelog +* Thu Dec 12 2024 lijian1 - 7.3.0-2020033101.59 +- Backport from upstream to fix contexpr list initialized member bug. + * Tue Dec 05 2023 liyancheng <412998149@qq.com> - 7.3.0-2020033101.58 - Delete useless auto-bolt feature.