This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
g++ 3.0.2 template parser too eager to error out
- From: Leonid A Broukhis <leob at mailcom dot com>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 9 Jan 2002 20:27:31 -0800
- Subject: g++ 3.0.2 template parser too eager to error out
The following program compiles, links and prints 25 when compiled with
Sun WorkShop 6 update 2 C++ 5.3, or with
Edison Design Group C/C++ Front End, version 2.43.1, but fails miserably
when compiled with gcc version 3.0.2:
template<class T> struct C {
typedef T qq;
enum { ww = 7 };
};
template<> struct C<int> {
enum { qq = 5 };
typedef int ww;
};
template<class T> struct D {
enum { qq = C<T>::qq * 5};
typedef typename C<T>::ww ww;
};
#include <iostream>
using namespace std;
int main() {
D<int>::ww x = D<int>::qq;
cout << x << endl;
return 0;
}