public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11847] New: std::string as template argument no longer works
@ 2003-08-07 18:33 James dot W dot Mckelvey at jpl dot nasa dot gov
  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
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: James dot W dot Mckelvey at jpl dot nasa dot gov @ 2003-08-07 18:33 UTC (permalink / raw)
  To: gcc-bugs

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");


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

end of thread, other threads:[~2003-09-02 20:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-07 18:33 [Bug c++/11847] New: std::string as template argument no longer works James dot W dot Mckelvey at jpl dot nasa dot gov
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

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).