re PR c++/38877 (Revision 143404 caused ICE on 447.dealII in SPEC CPU 2006)
PR c++/38877 * tree.c (lvalue_p_1): Allow non-fields in COMPONENT_REF. From-SVN: r143449
This commit is contained in:
parent
ef3818844c
commit
cc6bc76df8
|
@ -1,3 +1,8 @@
|
|||
2009-01-16 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/38877
|
||||
* tree.c (lvalue_p_1): Allow non-fields in COMPONENT_REF.
|
||||
|
||||
2009-01-16 Steve Ellcey <sje@cup.hp.com>
|
||||
|
||||
PR c++/31260
|
||||
|
|
|
@ -117,6 +117,8 @@ lvalue_p_1 (tree ref,
|
|||
situations. */
|
||||
op1_lvalue_kind = lvalue_p_1 (TREE_OPERAND (ref, 1),
|
||||
treat_class_rvalues_as_lvalues);
|
||||
else if (TREE_CODE (TREE_OPERAND (ref, 1)) != FIELD_DECL)
|
||||
/* This can be IDENTIFIER_NODE in a template. */;
|
||||
else if (DECL_C_BIT_FIELD (TREE_OPERAND (ref, 1)))
|
||||
{
|
||||
/* Clear the ordinary bit. If this object was a class
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
// PR c++/38877
|
||||
|
||||
template<class _T1, class _T2>
|
||||
struct pair
|
||||
{
|
||||
typedef _T1 first_type;
|
||||
typedef _T2 second_type;
|
||||
_T1 first;
|
||||
_T2 second;
|
||||
pair () : first(), second() { }
|
||||
pair(const _T1& __a, const _T2& __b)
|
||||
: first(__a), second(__b) { }
|
||||
};
|
||||
|
||||
template<class _T1, class _T2>
|
||||
inline pair<_T1, _T2>
|
||||
make_pair(_T1 __x, _T2 __y)
|
||||
{
|
||||
return pair<_T1, _T2>(__x, __y);
|
||||
}
|
||||
|
||||
template <int dim> class bar;
|
||||
|
||||
template <int dim>
|
||||
pair<bar<dim> *, unsigned int>
|
||||
foo (unsigned int position)
|
||||
{
|
||||
const pair<int,unsigned int> tmp;
|
||||
return make_pair (new bar<dim>(tmp.first),
|
||||
position);
|
||||
}
|
Loading…
Reference in New Issue