public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo commit in src/patchsets/gcc/4.9.3/gentoo: 80_all_gcc-4.9-c++-mangle-pr67337.patch
@ 2016-05-13 17:19 Mike Frysinger (vapier)
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger (vapier) @ 2016-05-13 17:19 UTC (permalink / raw
  To: gentoo-commits

vapier      16/05/13 17:19:23

  Added:                80_all_gcc-4.9-c++-mangle-pr67337.patch
  Log:
  upstream fix for ICE when using C++ templates #573068

Revision  Changes    Path
1.1                  src/patchsets/gcc/4.9.3/gentoo/80_all_gcc-4.9-c++-mangle-pr67337.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.3/gentoo/80_all_gcc-4.9-c++-mangle-pr67337.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.3/gentoo/80_all_gcc-4.9-c++-mangle-pr67337.patch?rev=1.1&content-type=text/plain

Index: 80_all_gcc-4.9-c++-mangle-pr67337.patch
===================================================================
https://gcc.gnu.org/PR67337
https://bugs.gentoo.org/573068

From b1414f2f32407bbe4bb8cc71216272cbf22eb6eb Mon Sep 17 00:00:00 2001
From: trippels <trippels@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 4 Dec 2015 11:46:39 +0000
Subject: [PATCH] Fix c++/67337 (segfault in mangle.c)

	PR c++/67337
	* mangle.c (write_template_prefix): Guard against context==NULL.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@231258 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/cp/ChangeLog                        |  5 +++++
 gcc/cp/mangle.c                         |  2 +-
 gcc/testsuite/g++.dg/template/pr67337.C | 25 +++++++++++++++++++++++++
 3 files changed, 31 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/g++.dg/template/pr67337.C

diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index c9b1c5f..3a22b0d 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -1118,7 +1118,7 @@ write_template_prefix (const tree node)
      So, for the example above, `Outer<int>::Inner' is represented as a
      substitution candidate by a TREE_LIST whose purpose is `Outer<int>'
      and whose value is `Outer<T>::Inner<U>'.  */
-  if (TYPE_P (context))
+  if (context && TYPE_P (context))
     substitution = build_tree_list (context, templ);
   else
     substitution = templ;
diff --git a/gcc/testsuite/g++.dg/template/pr67337.C b/gcc/testsuite/g++.dg/template/pr67337.C
new file mode 100644
index 0000000..df2651b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/pr67337.C
@@ -0,0 +1,25 @@
+template <class> class A
+{
+  void m_fn1 (int *, int);
+};
+
+template <class> class B
+{
+public:
+  typedef int Type;
+};
+
+template <class> class C
+{
+public:
+  C (int);
+  template <template <class> class T> void m_fn2 (typename T<void>::Type);
+};
+
+template <>
+void
+A<int>::m_fn1 (int *, int)
+{
+  C<int> a (0);
+  a.m_fn2<B> (0);
+}
-- 
2.7.4






^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-05-13 17:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-13 17:19 [gentoo-commits] gentoo commit in src/patchsets/gcc/4.9.3/gentoo: 80_all_gcc-4.9-c++-mangle-pr67337.patch Mike Frysinger (vapier)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox