This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ Patch / RFC] PR 50870


Hi again,
On 10/27/2011 08:57 AM, Paolo Carlini wrote:
Ok, thanks, I'll work more on this later today. Then, if we fix that we don't error out at all, right? Because this is a reject valid, AFAIK.
In that case, lookup_qualified_name shouldn't be returning error_mark_node.
A little more information, maybe more to come today: lookup_qualified_name calls lookup_member which actually gives up *very* early, because its first argument, xbasetype, aka TREE_OPERAND (member, 0) in tsubst_copy_and_build, has no binfo:

<record_type 0x7ffff577f9d8 impl type_0 type_5 type_6 VOID
align 8 symtab 0 alias set -1 canonical type 0x7ffff577f9d8 context <translation_unit_decl 0x7ffff5646170 D.1>
full-name "struct impl<V>"
no-binfo use_template=1 interface-unknown
chain <type_decl 0x7ffff57802e0 impl>>


thus (type is xbasetype completed):

1192   if (!basetype_path)
1193     basetype_path = TYPE_BINFO (type);
1194
1195   if (!basetype_path)
1196     return NULL_TREE;

NULL_TREE becomes error_mark_node in lookup_qualified_name.

For comparison, in 4_5-branch we have, for xbasetype, a very different story:

<record_type 0x7ffff5a15690 impl type_5 type_6 QI
size <integer_cst 0x7ffff7e6d730 type <integer_type 0x7ffff7e820a8 bit_size_type> constant 8>
unit size <integer_cst 0x7ffff7e6d758 type <integer_type 0x7ffff7e82000 long unsigned int> constant 1>
align 8 symtab 0 alias set -1 canonical type 0x7ffff5a15690
fields <type_decl 0x7ffff5a17170 impl
type <record_type 0x7ffff5a157e0 impl type_5 type_6 QI size <integer_cst 0x7ffff7e6d730 8> unit size <integer_cst 0x7ffff7e6d758 1>
align 8 symtab 0 alias set -1 canonical type 0x7ffff5a15690 fields <type_decl 0x7ffff5a17170 impl>
full-name "struct impl<float>"
X() X(constX&) this=(X&) n_parents=0 use_template=1 interface-unknown
chain <type_decl 0x7ffff5a170b8 impl>>
external nonlocal suppress-debug decl_4 VOID file 50870.C line 6 col 3
align 8 context <record_type 0x7ffff5a15690 impl> result <record_type 0x7ffff5a15690 impl>
>
full-name "struct impl<float>"
X() X(constX&) this=(X&) n_parents=0 use_template=1 interface-unknown
pointer_to_this <pointer_type 0x7ffff5a15738> chain <type_decl 0x7ffff5a170b8 impl>>


Paolo.





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]