mirror of git://gcc.gnu.org/git/gcc.git
re PR c++/45894 ([C++0x] ICE: segmentation fault with -Wall)
PR c++/45894 * tree.c (lvalue_kind): Don't crash if ref has NULL type. * g++.dg/warn/Wsequence-point-2.C: New test. From-SVN: r166481
This commit is contained in:
parent
b04533af33
commit
8810610ef1
|
|
@ -1,3 +1,8 @@
|
||||||
|
2010-11-09 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
PR c++/45894
|
||||||
|
* tree.c (lvalue_kind): Don't crash if ref has NULL type.
|
||||||
|
|
||||||
2010-11-08 Jason Merrill <jason@redhat.com>
|
2010-11-08 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
PR c++/46382
|
PR c++/46382
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,8 @@ lvalue_kind (const_tree ref)
|
||||||
== REFERENCE_TYPE)
|
== REFERENCE_TYPE)
|
||||||
return lvalue_kind (TREE_OPERAND (ref, 0));
|
return lvalue_kind (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 */
|
/* unnamed rvalue references are rvalues */
|
||||||
if (TYPE_REF_IS_RVALUE (TREE_TYPE (ref))
|
if (TYPE_REF_IS_RVALUE (TREE_TYPE (ref))
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
2010-11-09 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
PR c++/45894
|
||||||
|
* g++.dg/warn/Wsequence-point-2.C: New test.
|
||||||
|
|
||||||
2010-11-09 Janus Weil <janus@gcc.gnu.org>
|
2010-11-09 Janus Weil <janus@gcc.gnu.org>
|
||||||
|
|
||||||
PR fortran/46313
|
PR fortran/46313
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
// PR c++/45894
|
||||||
|
// { dg-do compile }
|
||||||
|
// { dg-options "-std=c++0x -Wsequence-point" }
|
||||||
|
|
||||||
|
struct F
|
||||||
|
{
|
||||||
|
template <typename = int>
|
||||||
|
void bar ();
|
||||||
|
};
|
||||||
|
template <typename = int>
|
||||||
|
struct V
|
||||||
|
{
|
||||||
|
V (const V &) { F::bar <>; }
|
||||||
|
};
|
||||||
|
struct C
|
||||||
|
{
|
||||||
|
V <> v;
|
||||||
|
};
|
||||||
|
struct B
|
||||||
|
{
|
||||||
|
C f ();
|
||||||
|
};
|
||||||
|
struct A
|
||||||
|
{
|
||||||
|
C c;
|
||||||
|
B b;
|
||||||
|
A () : c (b.f ()) { }
|
||||||
|
};
|
||||||
Loading…
Reference in New Issue