This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: g++-4.5 vs dwarf branch
- From: Roland McGrath <roland at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Wed, 24 Nov 2010 15:14:35 -0800
- Subject: Re: g++-4.5 vs dwarf branch
We spoke on IRC about the details and I think we're clear on the nit
cleanups I wanted to see before you commit/merge all this, but I'll reply
here anyway just for academic trivia.
> - std::pair<_T1, _T2>::second has incomplete type. This is strange. I
> haven't been able to reproduce it in a smaller setup. The error looks
> as follows:
>
> /usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../include/c
> ++/4.5.1/bits/stl_pair.h: In instantiation of std::pair<const
> elfutils::dwarf_output::debug_info_entry,
> elfutils::dwarf_output::die_info> :
> /home/mark/src/elfutils/libdw/c++/dwarf_output:233:63: instantiated
> from here
> /usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../include/c
> ++/4.5.1/bits/stl_pair.h:77:11: error: std::pair<_T1, _T2>::second has
> incomplete type
> /home/mark/src/elfutils/libdw/c++/dwarf_output:146:12: error: forward
> declaration of struct elfutils::dwarf_output::die_info
>
> Which doesn't make sense to me. The code it complains about is an
> invocation of vector<die_info_pair *>.end(). The following "patch" makes
> it go away. But I have no idea why, both code constructs seem to not
> actually use the pair directly:
Yeah, it seems odd since the only things being used are pointers.
If it were a simple case of 'struct opaque *' then it would not matter.
I suspect that the issue here is just that we are implicitly requiring
the template instantiations for std::pair<...>, even though the actual
type std::pair<...> is used only in ways that are ordinarily permissible
for undefined types.
Thanks,
Roland