* [Bug c++/11847] [3.4 regression] reference does not work as template argument any more
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 ` bangerth at dealii dot org
2003-08-07 18:48 ` bangerth at dealii dot org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: bangerth at dealii dot org @ 2003-08-07 18:46 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
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
GCC build triplet|sparc-sun-solaris2.7 |
GCC host triplet|sparc-sun-solaris2.7 |
GCC target triplet|sparc-sun-solaris2.7 |
Last reconfirmed|0000-00-00 00:00:00 |2003-08-07 18:46:04
date| |
Summary|std::string as template |[3.4 regression] reference
|argument no longer works |does not work as template
| |argument any more
------- Additional Comments From bangerth at dealii dot org 2003-08-07 18:46 -------
Indeed, I can confirm this on linux as well. Here's a smaller snippet:
----------------------------
extern const int a;
template <const int&> class X {};
template <typename> struct Y {
X<a> x;
};
template struct Y<int>;
----------------------------
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc
x.cc: In instantiation of `Y<int>':
x.cc:9: instantiated from here
x.cc:6: error: could not convert template argument `&a' to `const int&'
This used to work, but doesn't anymore. Since it only happens if Y is
a template class, it seems as if this may have something to do with
two-stage name lookup.
W.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/11847] [3.4 regression] reference does not work as template argument any more
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
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: bangerth at dealii dot org @ 2003-08-07 18:48 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
------- Additional Comments From bangerth at dealii dot org 2003-08-07 18:48 -------
Just a further clue that this might have something to do with
two-stage name lookup: if I make the variable template
dependent, then the code compiles again. Here's an example:
---------------------------
template <typename T> struct A {
static const T a;
};
template <const int&> class X {};
template <typename T> struct Y {
X<A<T>::a> x;
};
template struct Y<int>;
-----------------------------------
W.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/11847] [3.4 regression] reference does not work as template argument any more
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
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-08-07 18:49 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
------- Additional Comments From pinskia at physics dot uc dot edu 2003-08-07 18:49 -------
>From Phil's regression hunter: Search converges between 2003-07-07-trunk (#336) and 2003-
07-08-trunk (#337).
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/11847] [3.4 regression] reference does not work as template argument any more
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
` (2 preceding siblings ...)
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
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: janis187 at us dot ibm dot com @ 2003-08-11 21:01 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
janis187 at us dot ibm dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mmitchel at gcc dot gnu dot
| |org
------- Additional Comments From janis187 at us dot ibm dot com 2003-08-11 21:01 -------
The regression in PR 11847 was introduced or exposed by this patch:
--- gcc/gcc/cp/ChangeLog ---
2003-07-07 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (build_scoped_method_call): Remove.
(lookup_qualified_name): Remove parameter.
(tsubst_copy_and_build): Declare.
[lots more]
The regression hunt took place on i686-pc-linux-gnu using the test
case from comment #1.
This is the same patch that introduced the regression in PR 11834.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/11847] [3.4 regression] reference does not work as template argument any more
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
` (3 preceding siblings ...)
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
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: bangerth at dealii dot org @ 2003-08-20 14:36 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
------- Additional Comments From bangerth at dealii dot org 2003-08-20 14:36 -------
May be related to PR 11993.
W.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/11847] [3.4 regression] reference does not work as template argument any more
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
` (4 preceding siblings ...)
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
7 siblings, 0 replies; 9+ messages in thread
From: dhazeghi at yahoo dot com @ 2003-08-23 1:10 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
dhazeghi at yahoo dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |critical
Keywords| |rejects-valid
Priority|P2 |P1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/11847] [3.4 regression] reference does not work as template argument any more
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
` (5 preceding siblings ...)
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
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-09-02 20:54 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
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2003-09-02 20:54 -------
Subject: Bug 11847
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: mmitchel@gcc.gnu.org 2003-09-02 20:54:08
Modified files:
gcc/cp : ChangeLog pt.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/g++.dg/template: class1.C
Log message:
PR c++/11847
* pt.c (convert_nontype_argument): Correct representation of
REFERENCE_TYPE expressions.
PR c++/11847
* g++.dg/template/class1.C: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3637&r2=1.3638
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.770&r2=1.771
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3017&r2=1.3018
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/class1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/11847] [3.4 regression] reference does not work as template argument any more
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
` (6 preceding siblings ...)
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
7 siblings, 0 replies; 9+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2003-09-02 20:56 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
mmitchel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From mmitchel at gcc dot gnu dot org 2003-09-02 20:56 -------
Fixed in GCC 3.4.
^ permalink raw reply [flat|nested] 9+ messages in thread