This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11694] ICE with missing typename/template keywords
- From: "ehrhardt at mathematik dot uni-ulm dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Jul 2003 09:57:45 -0000
- Subject: [Bug c++/11694] ICE with missing typename/template keywords
- References: <20030728135514.11694.cholm@nbi.dk>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11694
ehrhardt at mathematik dot uni-ulm dot de changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |ice-on-invalid-code
Priority|P2 |P3
Last reconfirmed|0000-00-00 00:00:00 |2003-07-29 09:57:44
date| |
Summary|Template member class of |ICE with missing
|template class mix-up |typename/template keywords
Target Milestone|3.4 |3.3.2
Version|3.2.2 |3.3.1
------- Additional Comments From ehrhardt at mathematik dot uni-ulm dot de 2003-07-29 09:57 -------
The code is invalid. This line:
typedef foo<A, A>::helper<1> helper_type;
must be written as
typedef typename foo<A, A>::template helper<1> helper_type;
However, gcc should not issue an Internal Compiler Error. This is
fixed in 3.4. Note that there are two different ICEs, one if both
typename and template are are missing. There's another one if
template is there but typename is missing.
Reduced example:
template <typename , typename >
struct foo {
template <int> struct helper { };
};
template <typename A>
struct bar : public foo<A, A>
{
typedef foo<A, A>::helper<1> helper_type;
};
bar<double> b1();
regards Christian