This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13825] New: template instantiation fails due to substituting the wrong type for a parameter
- From: "mps at sonartech dot com dot au" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Jan 2004 05:08:25 -0000
- Subject: [Bug c++/13825] New: template instantiation fails due to substituting the wrong type for a parameter
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following code is correct, I think, but gcc 3.3.2 rejects it.
Its messages say it's doing an instantiation with B_PARAM=int.
I think that's it's mistake.
template <typename A_PARAM>
struct A {};
template <typename B_PARAM>
struct B {
template <typename B1_PARAM>
struct B1 {
B1 (B_PARAM);
};
};
template <typename C_PARAM>
struct C {
typedef A <C_PARAM> a_t;
typename B <a_t>::B1 <a_t> _b1;
C () : _b1 (a_t ()) {}
};
int
main ()
{
C <int> c;
}
--
Summary: template instantiation fails due to substituting the
wrong type for a parameter
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mps at sonartech dot com dot au
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: What's a triplet anyway?
GCC host triplet: Intel Debian Linux 2.4.22
GCC target triplet: Not cross-compiling
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13825