[Bug c++/15179] Error message can be improved
redi at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Thu Aug 5 11:25:00 GMT 2004
------- Additional Comments From redi at gcc dot gnu dot org 2004-08-05 11:24 -------
It doesn't need to involve nested classes either:
-----------------------------
template <bool>
struct A {
typedef int type;
};
template <bool yn>
struct B {
typedef A<yn>::type Type;
};
-----------------------------
3.4 and mainline give:
bug.cc:8: error: type `A<<anonymous> >' is not derived from type `B<yn>'
bug.cc:8: error: ISO C++ forbids declaration of `type' with no type
bug.cc:8: error: expected `;' before "Type"
Again, the problem is a missing "typename" but you can't guess that from the
diagnostic. Compiling the same code with GCC 3.3 gives the "implicit typename
is deprecated" warning which makes the error much easier to find, therefore I
consider this a regression against 3.3
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15179
More information about the Gcc-bugs
mailing list