public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "James dot W dot Mckelvey at jpl dot nasa dot gov" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/11847] New: std::string as template argument no longer works
Date: Thu, 07 Aug 2003 18:33:00 -0000	[thread overview]
Message-ID: <20030807183306.11847.James.W.Mckelvey@jpl.nasa.gov> (raw)

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11847

           Summary: std::string as template argument no longer works
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: James dot W dot Mckelvey at jpl dot nasa dot gov
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: sparc-sun-solaris2.7
  GCC host triplet: sparc-sun-solaris2.7
GCC target triplet: sparc-sun-solaris2.7

This error was introduced a few weeks ago. The problem is not in class X, but in
template class Y creating an object of class X using a std::string template
argument. If Y is made non-template, the error disappears.

This code also works on the Compaq cxx and others, so I'm convinced it's a bug.

Reading specs from /mnt/home3/utilities/lib/gcc/sparc-sun-solaris2.7/3.4/specs
Configured with: /mnt/home3/utilities/gcc/configure
--prefix=/mnt/home3/utilities --verbose --with-as=/mnt/home3/utilities/bin/as
--with-ld=/mnt/home3/utilities/bin/ld --with-gnu-as --with-gnu-ld
--disable-multilib --enable-languages=c++
Thread model: posix
gcc version 3.4 20030806 (experimental)
 /mnt/home3/utilities/libexec/gcc/sparc-sun-solaris2.7/3.4/cc1plus -quiet -v
zz.cc -quiet -dumpbase zz.cc -mcpu=v7 -auxbase zz -version -o /tmp/ccy1ULwk.s
#include "..." search starts here:
#include <...> search starts here:
 /mnt/home3/utilities/lib/gcc/sparc-sun-solaris2.7/3.4/../../../../include/c++/3.4
 /mnt/home3/utilities/lib/gcc/sparc-sun-solaris2.7/3.4/../../../../include/c++/3.4/sparc-sun-solaris2.7
 /mnt/home3/utilities/lib/gcc/sparc-sun-solaris2.7/3.4/../../../../include/c++/3.4/backward
 /usr/local/include
 /mnt/home3/utilities/include
 /mnt/home3/utilities/lib/gcc/sparc-sun-solaris2.7/3.4/include
 /mnt/home3/utilities/lib/gcc/sparc-sun-solaris2.7/3.4/../../../../sparc-sun-solaris2.7/include
 /usr/include
End of search list.
GNU C++ version 3.4 20030806 (experimental) (sparc-sun-solaris2.7)
	compiled by GNU C version 3.4 20030806 (experimental).
GGC heuristics: --param ggc-min-expand=65 --param ggc-min-heapsize=65536
zz.cc: In instantiation of `Y<int>':
zz.cc:26:   instantiated from here
zz.cc:18: error: could not convert template argument `&s' to `const 
   std::basic_string<char, std::char_traits<char>, std::allocator<char> >&'

#include <string>


template <const std::string& s>

class X
{
};


extern const std::string s;


template <class T>

class Y
{
    X<s> x;
};


int

main(void)
{
    Y<int> y;

    return 0;
}


const std::string s("who");


             reply	other threads:[~2003-08-07 18:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-07 18:33 James dot W dot Mckelvey at jpl dot nasa dot gov [this message]
2003-08-07 18:46 ` [Bug c++/11847] [3.4 regression] reference does not work as template argument any more bangerth at dealii dot org
2003-08-07 18:48 ` bangerth at dealii dot org
2003-08-07 18:49 ` pinskia at physics dot uc dot edu
2003-08-11 21:01 ` janis187 at us dot ibm dot com
2003-08-20 14:36 ` bangerth at dealii dot org
2003-08-23  1:10 ` dhazeghi at yahoo dot com
2003-09-02 20:54 ` cvs-commit at gcc dot gnu dot org
2003-09-02 20:56 ` mmitchel at gcc dot gnu dot org

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=20030807183306.11847.James.W.Mckelvey@jpl.nasa.gov \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).