From: mec.gnu@mindspring.com (Michael Elizabeth Chastain)
To: carlton@kealia.com, drow@mvista.com
Cc: gdb@sources.redhat.com
Subject: Foo<int,(char*)&string>
Date: Tue, 17 Feb 2004 02:20:00 -0000 [thread overview]
Message-ID: <20040217022008.24CA64B104@berman.michael-chastain.com> (raw)
Here's a test program, derived from gdb.cp/templates.cc:
#include <iostream>
#include <string.h>
template <class T, char * name>
class Foo
{
public:
int method ();
};
template <class T, char * name> int Foo<T, name>::method ()
{
return strlen (name);
}
char string [10] = "hello";
int main ()
{
Foo <int, string> f1;
std::cout << f1.method () << std::endl;
return 0;
}
The second template parameter is a "char *"; a value, not a type.
gcc 3.3.2 -gstabs+ emits this:
.stabs "Foo<int,&string>:Tt(1,1)=..."
gcc HEAD -gstabs+ just changed to emit this:
.stabs "Foo<int,(char*)(&string)>:Tt(0,25)=..."
Do we care? I think the "(char*)(&string)" looks ugly but is legal.
I want to change templates.exp to accept this as a PASS. I've found
enough serious stabs+ bugs with gcc that I don't want to make a fuss
over this difference.
What do you think?
Michael C
next reply other threads:[~2004-02-17 2:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-17 2:20 Michael Elizabeth Chastain [this message]
2004-02-17 2:44 ` Foo<int,(char*)&string> Daniel Jacobowitz
2004-02-18 0:20 ` Foo<int,(char*)&string> 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=20040217022008.24CA64B104@berman.michael-chastain.com \
--to=mec.gnu@mindspring.com \
--cc=carlton@kealia.com \
--cc=drow@mvista.com \
--cc=gdb@sources.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