This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 2/2] PR debug/63240 Add DWARF representation for C++11 defaulted member function.
- From: Siva Chandra <sivachandra at google dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Mark Wielaard <mjw at redhat dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Jonathan Wakely <jwakely at redhat dot com>, dodji at redhat dot com
- Date: Fri, 3 Oct 2014 10:15:32 -0700
- Subject: Re: [PATCH 2/2] PR debug/63240 Add DWARF representation for C++11 defaulted member function.
- Authentication-results: sourceware.org; auth=none
- References: <1412341922-7891-1-git-send-email-mjw at redhat dot com> <1412341922-7891-2-git-send-email-mjw at redhat dot com> <542EB00A dot 8040605 at redhat dot com> <CAGyQ6gybMMwfhmMjjnSdEybxmAK3QwXWVLe7x7cLBm_oL0Dfaw at mail dot gmail dot com>
On Fri, Oct 3, 2014 at 10:13 AM, Siva Chandra <sivachandra@google.com> wrote:
> On Fri, Oct 3, 2014 at 7:17 AM, Jason Merrill <jason@redhat.com> wrote:
>> On 10/03/2014 09:12 AM, Mark Wielaard wrote:
>>>
>>> A debugger not knowing whether a special member function was explicitly
>>> defaulted, implicitly declared or explicitly defined seems less confusion
>>> than not knowing whether it was deleted. But there are some subtle cases
>>> where knowing whether a constructor was user defined or explicitly
>>> defaulted do matter for whether the default constructor might have been
>>> implicitly generated.
>>
>>
>> Can you elaborate?
>>
>>> So like the deleted case this patch introduces
>>> a new attribute DW_AT_GNU_defaulted that gets attached to the function
>>> declaration. Note that since this is for declarations we explicitly
>>> test for DECL_DEFAULTED_IN_CLASS_P and ignore any implementation
>>> definitions that use = default; outside the class body.
>>
>>
>> Hmm, I'm dubious about this choice. How do you expect a consumer to use
>> this information?
>
> I apologize for gate crashing here...
>
> Currently, there is no special attribute to indicate that a special
> member function is declared = default. So, if you have a class
> definition like this:
>
> class A
> {
> public:
> A () {}
> ~A () = default;
> int a;
> };
>
> then, GDB sees the declaration of the destructor with no special
> attributes (like DW_AT_artificial or similar) and thinks that the copy
> constructor is user defined.
Aww, sorry. I should have said destructor instead of copy constructor.