From 72fce289e30887661236f0413dca8de742f6d2e0 Mon Sep 17 00:00:00 2001 From: Tony Theodore Date: Sun, 31 May 2020 19:30:04 +1000 Subject: [PATCH] gcc: fix for qt 5.15 fixes #2509 --- src/gcc-1-fixes.patch | 80 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 76 insertions(+), 4 deletions(-) diff --git a/src/gcc-1-fixes.patch b/src/gcc-1-fixes.patch index 4f8a476f..73c42fe9 100644 --- a/src/gcc-1-fixes.patch +++ b/src/gcc-1-fixes.patch @@ -5,7 +5,7 @@ Contains ad hoc patches for cross building. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Tony Theodore Date: Thu, 2 Feb 2017 02:05:50 +1100 -Subject: [PATCH 1/4] allow native cpu detection when building with clang +Subject: [PATCH 1/5] allow native cpu detection when building with clang function was disabled for non-gcc5 in: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=b587c12551143c14f023860a1dbdf7316ae71f27;hp=43096b526a9f23008b9769372f11475ae63487bc @@ -29,7 +29,7 @@ index 1111111..2222222 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Tony Theodore Date: Fri, 6 Apr 2018 13:40:22 +1000 -Subject: [PATCH 2/4] remove hard-coded mingw from include path +Subject: [PATCH 2/5] remove hard-coded mingw from include path diff --git a/gcc/config.gcc b/gcc/config.gcc @@ -62,7 +62,7 @@ index 1111111..2222222 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Cameron Kaiser Date: Sat, 13 Oct 2018 18:59:18 -0700 -Subject: [PATCH 3/4] fix gcc compile error on ppc64le +Subject: [PATCH 3/5] fix gcc compile error on ppc64le https://gcc.gnu.org/viewcvs/gcc/branches/gcc-6-branch/libcpp/lex.c?view=log&pathrev=261621 @@ -83,7 +83,7 @@ index 1111111..2222222 100644 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: uros Date: Sun, 11 Nov 2018 17:44:43 +0000 -Subject: [PATCH 4/4] Backport from mainline 2018-11-04 Uros Bizjak +Subject: [PATCH 4/5] Backport from mainline 2018-11-04 Uros Bizjak PR middle-end/58372 @@ -132,3 +132,75 @@ index 1111111..2222222 100644 /* Remove unreachable blocks, otherwise we cannot compute dominators which are needed for loop state verification. As a side-effect this also compacts blocks. + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Tony Theodore +Date: Sun, 31 May 2020 18:36:27 +1000 +Subject: [PATCH 5/5] PR c++/66297, DR 1684 - literal class and constexpr + member fns + +taken from: +https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=54069e595976eb556b22c231951cb2703e523a22;hp=8ef2b9a7b59418d9f5e644badbc0aade7f83414f + +diff --git a/gcc/cp/class.c b/gcc/cp/class.c +index 1111111..2222222 100644 +--- a/gcc/cp/class.c ++++ b/gcc/cp/class.c +@@ -5549,7 +5549,9 @@ finalize_literal_type_property (tree t) + && !TYPE_HAS_CONSTEXPR_CTOR (t)) + CLASSTYPE_LITERAL_P (t) = false; + +- if (!CLASSTYPE_LITERAL_P (t)) ++ /* C++14 DR 1684 removed this restriction. */ ++ if (cxx_dialect < cxx14 ++ && !CLASSTYPE_LITERAL_P (t) && !LAMBDA_TYPE_P (t)) + for (fn = TYPE_METHODS (t); fn; fn = DECL_CHAIN (fn)) + if (DECL_DECLARED_CONSTEXPR_P (fn) + && TREE_CODE (fn) != TEMPLATE_DECL +@@ -5557,12 +5559,11 @@ finalize_literal_type_property (tree t) + && !DECL_CONSTRUCTOR_P (fn)) + { + DECL_DECLARED_CONSTEXPR_P (fn) = false; +- if (!DECL_GENERATED_P (fn)) +- { +- error ("enclosing class of constexpr non-static member " +- "function %q+#D is not a literal type", fn); +- explain_non_literal_class (t); +- } ++ if (!DECL_GENERATED_P (fn) ++ && pedwarn (DECL_SOURCE_LOCATION (fn), OPT_Wpedantic, ++ "enclosing class of constexpr non-static member " ++ "function %q+#D is not a literal type", fn)) ++ explain_non_literal_class (t); + } + } + +diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c +index 1111111..2222222 100644 +--- a/gcc/cp/constexpr.c ++++ b/gcc/cp/constexpr.c +@@ -219,16 +219,17 @@ is_valid_constexpr_fn (tree fun, bool complain) + } + } + +- if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fun) ++ /* C++14 DR 1684 removed this restriction. */ ++ if (cxx_dialect < cxx14 ++ && DECL_NONSTATIC_MEMBER_FUNCTION_P (fun) + && !CLASSTYPE_LITERAL_P (DECL_CONTEXT (fun))) + { + ret = false; +- if (complain) +- { +- error ("enclosing class of constexpr non-static member " +- "function %q+#D is not a literal type", fun); +- explain_non_literal_class (DECL_CONTEXT (fun)); +- } ++ if (complain ++ && pedwarn (DECL_SOURCE_LOCATION (fun), OPT_Wpedantic, ++ "enclosing class of constexpr non-static member " ++ "function %q+#D is not a literal type", fun)) ++ explain_non_literal_class (DECL_CONTEXT (fun)); + } + } + else if (CLASSTYPE_VBASECLASSES (DECL_CONTEXT (fun)))