[gcc-6] 318/401: * Fix PR c++/78774, proposed for the gcc-6-branch.

Ximin Luo infinity0 at debian.org
Wed Apr 5 15:50:22 UTC 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch pu/reproducible_builds
in repository gcc-6.

commit 52372543af9c0ea79248a0e25b2bc5c5b6b7557b
Author: doko <doko at 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>
Date:   Thu Dec 15 08:10:45 2016 +0000

      * Fix PR c++/78774, proposed for the gcc-6-branch.
    
    
    git-svn-id: svn://anonscm.debian.org/gcccvs/branches/sid/gcc-6@9186 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
---
 debian/changelog            |  1 +
 debian/patches/pr78774.diff | 49 +++++++++++++++++++++++++++++++++++++++++++++
 debian/rules.patch          |  1 +
 3 files changed, 51 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 6b6de2a..c47f23f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
 gcc-6 (6.2.1-7) UNRELEASED; urgency=medium
 
   * Drop build dependency on g++-5.
+  * Fix PR c++/78774, proposed for the gcc-6-branch.
 
  -- Matthias Klose <doko at debian.org>  Tue, 13 Dec 2016 08:37:46 +0100
 
diff --git a/debian/patches/pr78774.diff b/debian/patches/pr78774.diff
new file mode 100644
index 0000000..681b66a
--- /dev/null
+++ b/debian/patches/pr78774.diff
@@ -0,0 +1,49 @@
+# DP: Fix PR c++/78774, proposed for the gcc-6-branch
+
+PR c++/78774 - [6/7 Regression] ICE in constexpr string literals and templates
+
+gcc/cp/ChangeLog:
+
+	PR c++/78774
+	* pt.c (convert_template_argument): Avoid assuming operand type
+	is non-null since that of SCOPE_REF is not.
+
+gcc/testsuite/ChangeLog:
+
+	PR c++/78774
+	* g++.dg/cpp1y/pr78774.C: New test.
+
+diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
+index 97d0b48..1d68fcc 100644
+--- a/src/gcc/cp/pt.c
++++ b/src/gcc/cp/pt.c
+@@ -7375,9 +7375,11 @@ convert_template_argument (tree parm,
+           /* Reject template arguments that are references to built-in
+              functions with no library fallbacks.  */
+           const_tree inner = TREE_OPERAND (val, 0);
+-          if (TREE_CODE (TREE_TYPE (inner)) == REFERENCE_TYPE
+-              && TREE_CODE (TREE_TYPE (TREE_TYPE (inner))) == FUNCTION_TYPE
+-              && TREE_CODE (TREE_TYPE (inner)) == REFERENCE_TYPE
++	  const_tree innertype = TREE_TYPE (inner);
++          if (innertype
++	      && TREE_CODE (innertype) == REFERENCE_TYPE
++              && TREE_CODE (TREE_TYPE (innertype)) == FUNCTION_TYPE
++              && TREE_CODE (innertype) == REFERENCE_TYPE
+               && 0 < TREE_OPERAND_LENGTH (inner)
+               && reject_gcc_builtin (TREE_OPERAND (inner, 0)))
+               return error_mark_node;
+diff --git a/gcc/testsuite/g++.dg/cpp1y/pr78774.C b/gcc/testsuite/g++.dg/cpp1y/pr78774.C
+new file mode 100644
+index 0000000..c77032d
+--- /dev/null
++++ b/src/gcc/testsuite/g++.dg/cpp1y/pr78774.C
+@@ -0,0 +1,9 @@
++// PR c++/78774 - [6/7 Regression] ICE in constexpr string literals and
++// templates
++// { dg-do compile { target c++14 } }
++
++template <int> struct ops {
++  template <int> struct A;
++  template <int *Ptr> using explode = typename A<*Ptr>::join;
++};
++template <typename Ts> typename ops<'\0'>::explode<Ts::join>::type a;
diff --git a/debian/rules.patch b/debian/rules.patch
index a16b850..541eb96 100644
--- a/debian/rules.patch
+++ b/debian/rules.patch
@@ -103,6 +103,7 @@ debian_patches += \
 	libobjc-system-gc \
 	compress-debug-check \
 	pr77267 \
+	pr78774 \
 
 
 ifeq ($(libstdcxx_abi),new)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/gcc-6.git



More information about the Reproducible-commits mailing list