This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/10199: [3.3 regression] method parametrized by template does not work everywhere
- From: Matthias Klose <doko at net dot local>
- To: gcc-gnats at gcc dot gnu dot org, debian-gcc at lists dot debian dot org
- Date: Mon, 24 Mar 2003 07:32:09 +0100
- Subject: c++/10199: [3.3 regression] method parametrized by template does not work everywhere
- Reply-to: 185604 at bugs dot debian dot org
>Number: 10199
>Category: c++
>Synopsis: [3.3 regression] method parametrized by template does not work everywhere
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Mon Mar 24 06:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Thimo Neubauer <thimo at debian dot org>
>Release: 3.3 CVS 20030323
>Organization:
The Debian Project
>Environment:
>Description:
[ Reported to the Debian BTS as report #185604.
Please CC 185604 at bugs dot debian dot org on replies.
Log of report can be found at http://bugs.debian.org/185604 ]
- 3.2 CVS 20030316 rejects the code
- 3.3 CVS 20030323 ICEs in the error message (the regression)
- 3.4 CVS 20030316 compiles the code
$ g++-3.2 bugs-185604.cc
bugs-185604.cc: In function `void bar(T&) [with T = int]':
bugs-185604.cc:26: instantiated from here
bugs-185604.cc:18: no matching function for call to `X::bar()'
$ g++-3.3 bugs-185604.cc
bugs-185604.cc: In function `void bar(T&)':
bugs-185604.cc:18: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
The following program is valid C++, but does not compile:
-- snip --
class X {
public:
template<int d>
int bar () {return d;}
};
template<int x>
int fooo ()
{
return x;
}
template<class T>
void bar (T& g)
{
int kk = fooo<17>(); // OK
X x;
int k = x.bar<17>(); // Not OK
}
int main ()
{
X x;
int k=x.bar<17>(); // OK
int n;
bar(n);
}
-- snip --
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
System: Debian GNU/Linux (unstable)
Architecture: i686