re PR c++/47589 (internal compiler error: Segmentation fault)

2011-02-03  Jonathan Wakely  <jwakely.gcc@gmail.com>

	PR c++/47589
	Backport from mainline
	2010-11-09  Jakub Jelinek  <jakub@redhat.com>

	PR c++/45894
	* tree.c (lvalue_kind): Don't crash if ref has NULL type.

From-SVN: r169813
This commit is contained in:
Jonathan Wakely 2011-02-03 22:34:51 +00:00 committed by Jonathan Wakely
parent e453bce95f
commit 9fec765f9c
4 changed files with 42 additions and 1 deletions

View File

@ -1,3 +1,12 @@
2011-02-03 Jonathan Wakely <jwakely.gcc@gmail.com>
PR c++/47589
Backport from mainline
2010-11-09 Jakub Jelinek <jakub@redhat.com>
PR c++/45894
* tree.c (lvalue_kind): Don't crash if ref has NULL type.
2010-12-07 Jakub Jelinek <jakub@redhat.com>
Backport from mainline

View File

@ -72,7 +72,8 @@ lvalue_p_1 (tree ref)
== REFERENCE_TYPE)
return lvalue_p_1 (TREE_OPERAND (ref, 0));
if (TREE_CODE (TREE_TYPE (ref)) == REFERENCE_TYPE)
if (TREE_TYPE (ref)
&& TREE_CODE (TREE_TYPE (ref)) == REFERENCE_TYPE)
{
/* unnamed rvalue references are rvalues */
if (TYPE_REF_IS_RVALUE (TREE_TYPE (ref))

View File

@ -1,3 +1,8 @@
2011-02-03 Jonathan Wakely <jwakely.gcc@gmail.com>
PR c++/47589
* g++.dg/pr47589.C: New test.
2011-01-31 Nathan Froyd <froydnj@codesourcery.com>
Backport from mainline:

View File

@ -0,0 +1,26 @@
// PR c++/47589
// { dg-do compile }
struct F
{
typedef void(*Cb)();
F(Cb);
};
struct C
{
template<class D> static void f();
};
template<class D>
struct TF : F
{
TF() : F(C::f<D>) { }
};
struct DTC : TF<DTC>
{
DTC() { }
};