public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gcc-bugzilla at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/14122] New: problem with non-type tmplt parm in member template
Date: Thu, 12 Feb 2004 00:33:00 -0000	[thread overview]
Message-ID: <20040212003350.14122.snyder@fnal.gov> (raw)


g++ gives an error compiling the source given below.

$ g++ -c x.cc
x.cc: In instantiation of `A<(&str)>':
x.cc:9:   instantiated from here
x.cc:6: error: could not convert template argument `&str' to `const char*'
x.cc:6: error: could not convert template argument `&str' to `const char*'
x.cc:6: error: could not convert template argument `&str' to `const char*'
$

While i don't have a language reference handy at the moment, i don't
see anything wrong with the code.  Further, gcc accepted it through
at least the beginning of January.

Oddly, the error goes away if the `const' qualifier on `str' is removed.

Environment:
System: Linux karma 2.6.1 #10 Tue Feb 10 04:31:35 EST 2004 i686 i686 i386 GNU/Linux
Architecture: i686

	<machine, os, target, libraries (multiple lines)>
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc/configure --prefix=/usr/local/gcc --enable-threads=posix --enable-long-long --enable-languages=c,c++,f77

How-To-Repeat:

Compile the following:

-----------------------------------------
extern const char str[];

template <const char* P>
struct A
{
  template <const char* R>  void foo();
};

template class A<str>;
-----------------------------------------
------- Additional Comments From snyder at fnal dot gov  2004-02-12 00:33 -------
Fix:
	<how to correct or work around the problem, if known (multiple lines)>

-- 
           Summary: problem with non-type tmplt parm in member template
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: snyder at fnal dot gov
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


             reply	other threads:[~2004-02-12  0:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-12  0:33 gcc-bugzilla at gcc dot gnu dot org [this message]
2004-02-12  9:38 ` [Bug c++/14122] " pinskia at gcc dot gnu dot org
2004-02-14  0:43 ` [Bug c++/14122] [3.4/3.5 Regression] " mmitchel at gcc dot gnu dot org
2004-02-14  0:49 ` cvs-commit at gcc dot gnu dot org
2004-02-14  2:33 ` cvs-commit at gcc dot gnu dot org
2004-02-14  2:35 ` 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=20040212003350.14122.snyder@fnal.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).