re PR c++/52596 ([C++11] internal compiler error: in lvalue_kind, at cp/tree.c:153)
PR c++/52596 * semantics.c (finish_non_static_data_member): In templates, pass the decl to build_qualified_name. * tree.c (lvalue_kind) [SCOPE_REF]: Handle FIELD_DECL. From-SVN: r186187
This commit is contained in:
parent
b258592a08
commit
c5c8755af0
5 changed files with 38 additions and 3 deletions
|
@ -1,3 +1,10 @@
|
|||
2012-04-05 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/52596
|
||||
* semantics.c (finish_non_static_data_member): In templates, pass
|
||||
the decl to build_qualified_name.
|
||||
* tree.c (lvalue_kind) [SCOPE_REF]: Handle FIELD_DECL.
|
||||
|
||||
2012-04-04 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/52845
|
||||
|
|
|
@ -1590,7 +1590,7 @@ finish_non_static_data_member (tree decl, tree object, tree qualifying_scope)
|
|||
else if (processing_template_decl)
|
||||
return build_qualified_name (TREE_TYPE (decl),
|
||||
qualifying_scope,
|
||||
DECL_NAME (decl),
|
||||
decl,
|
||||
/*template_p=*/false);
|
||||
else
|
||||
{
|
||||
|
|
|
@ -151,8 +151,14 @@ lvalue_kind (const_tree ref)
|
|||
/* A scope ref in a template, left as SCOPE_REF to support later
|
||||
access checking. */
|
||||
case SCOPE_REF:
|
||||
gcc_assert (!type_dependent_expression_p (CONST_CAST_TREE(ref)));
|
||||
return lvalue_kind (TREE_OPERAND (ref, 1));
|
||||
gcc_assert (!type_dependent_expression_p (CONST_CAST_TREE (ref)));
|
||||
{
|
||||
tree op = TREE_OPERAND (ref, 1);
|
||||
if (TREE_CODE (op) == FIELD_DECL)
|
||||
return (DECL_C_BIT_FIELD (op) ? clk_bitfield : clk_ordinary);
|
||||
else
|
||||
return lvalue_kind (op);
|
||||
}
|
||||
|
||||
case MAX_EXPR:
|
||||
case MIN_EXPR:
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2012-04-05 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/52596
|
||||
* g++.dg/template/qualified-id5.C: New.
|
||||
|
||||
2012-04-05 Uros Bizjak <ubizjak@gmail.com>
|
||||
|
||||
PR target/52882
|
||||
|
|
17
gcc/testsuite/g++.dg/template/qualified-id5.C
Normal file
17
gcc/testsuite/g++.dg/template/qualified-id5.C
Normal file
|
@ -0,0 +1,17 @@
|
|||
// PR c++/52596
|
||||
|
||||
struct msgpack_zone_finalizer_array {
|
||||
int* tail;
|
||||
};
|
||||
struct msgpack_zone {
|
||||
msgpack_zone_finalizer_array finalizer_array;
|
||||
};
|
||||
struct zone : public msgpack_zone {
|
||||
template <typename T> T* allocate();
|
||||
|
||||
};
|
||||
template <typename T>
|
||||
T* zone::allocate()
|
||||
{
|
||||
--msgpack_zone::finalizer_array.tail;
|
||||
}
|
Loading…
Add table
Reference in a new issue