Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Foo<int,(char*)&string>
@ 2004-02-17  2:20 Michael Elizabeth Chastain
  2004-02-17  2:44 ` Foo<int,(char*)&string> Daniel Jacobowitz
  2004-02-18  0:20 ` Foo<int,(char*)&string> David Carlton
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Elizabeth Chastain @ 2004-02-17  2:20 UTC (permalink / raw)
  To: carlton, drow; +Cc: gdb

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-02-18  0:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-17  2:20 Foo<int,(char*)&string> Michael Elizabeth Chastain
2004-02-17  2:44 ` Foo<int,(char*)&string> Daniel Jacobowitz
2004-02-18  0:20 ` Foo<int,(char*)&string> David Carlton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox