From: David Carlton <david.carlton@sun.com>
To: Jim Blandy <jimb@redhat.com>
Cc: gdb@sources.redhat.com
Subject: Re: representing C++ constructors in GDB's symbol tables
Date: Sat, 18 Sep 2004 00:18:00 -0000 [thread overview]
Message-ID: <yf2ekl0a0ra.fsf@kealia.sfbay.sun.com> (raw)
In-Reply-To: <vt2pt4ko6p7.fsf@zenia.home> (Jim Blandy's message of "Fri, 17 Sep 2004 17:45:40 -0500")
On Fri, 17 Sep 2004 17:45:40 -0500, Jim Blandy <jimb@redhat.com> said:
> It occured to me that perhaps constructors should not be in the
> VAR_DOMAIN.
This sounds plausible, though I'm not entirely convinced, but for what
it's worth this next claim of yours isn't really true:
> You can't use them by name in expressions: you have to say "new
> X(...)", never "X(...)".
You can use "X(...)" to create a temporary object of type X. E.g. the
following program works fine.
#include <iostream>
class Printer {
public:
void print() const {
std::cout << "print!\n";
}
};
int main() {
Printer().print();
return 0;
}
Having said that, a constructor really is a different beast from an
ordinary function call. And I don't think that having GDB support
(gdb) print Printer().print()
should be high on your list of priorities.
David Carlton
david.carlton@sun.com
next prev parent reply other threads:[~2004-09-18 0:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-17 22:46 Jim Blandy
2004-09-18 0:14 ` Daniel Jacobowitz
2004-09-18 0:18 ` David Carlton [this message]
2004-09-18 2:29 ` Michael Chastain
2004-09-20 16:36 ` David Carlton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=yf2ekl0a0ra.fsf@kealia.sfbay.sun.com \
--to=david.carlton@sun.com \
--cc=gdb@sources.redhat.com \
--cc=jimb@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).