backport fix contexpr list initialized member.
This commit is contained in:
parent
b510c7a5d0
commit
0f2a62f563
72
Backport-fix-contexpr-list-initialized-member.patch
Normal file
72
Backport-fix-contexpr-list-initialized-member.patch
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
From fceecb5f37d65944c822bd172cde89e670669d49 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jason Merrill <jason@redhat.com>
|
||||||
|
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 <jason@redhat.com>
|
||||||
|
+ PR c++/82461 - constexpr list-initialized member
|
||||||
|
+ * constexpr.c (potential_constant_expression_1): Check
|
||||||
|
+ TARGET_EXPR_DIRECT_INIT_P.
|
||||||
|
+
|
||||||
|
2018-02-15 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
7
gcc.spec
7
gcc.spec
@ -41,7 +41,7 @@ Version: 7.3.0
|
|||||||
# number 2020033101 meaning the openEuler 20.03 release date plus 01 to
|
# number 2020033101 meaning the openEuler 20.03 release date plus 01 to
|
||||||
# replace DATE and will never change it in the future.
|
# replace DATE and will never change it in the future.
|
||||||
%global openEulerDATE 2020033101
|
%global openEulerDATE 2020033101
|
||||||
Release: %{openEulerDATE}.58
|
Release: %{openEulerDATE}.59
|
||||||
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
|
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
|
||||||
Group: Development/Languages
|
Group: Development/Languages
|
||||||
#Source0: hcc-aarch64-linux-release.tar.bz2
|
#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
|
Patch57: Backport-AArch64-Fix-longbranch-test.patch
|
||||||
Patch58: Backport-re-PR-tree-optimization-84552-Compile-time-.patch
|
Patch58: Backport-re-PR-tree-optimization-84552-Compile-time-.patch
|
||||||
Patch59: delete-auto-bolt-feature.patch
|
Patch59: delete-auto-bolt-feature.patch
|
||||||
|
Patch60: Backport-fix-contexpr-list-initialized-member.patch
|
||||||
#AutoReqProv: off
|
#AutoReqProv: off
|
||||||
AutoReq: true
|
AutoReq: true
|
||||||
|
|
||||||
@ -3338,6 +3338,9 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Dec 12 2024 lijian1<lijian1@kylinos.cn> - 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
|
* Tue Dec 05 2023 liyancheng <412998149@qq.com> - 7.3.0-2020033101.58
|
||||||
- Delete useless auto-bolt feature.
|
- Delete useless auto-bolt feature.
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user