------- Comment #1 from pinskia at gcc dot gnu dot org 2005-11-05 00:55 -------
Hmm, GCC seems to think "size ? 1 : d->size" is type-dependent in a way it is
as D is type dependent. Someone else with more knowlege of the C++ standard
will have to comment.
Another testcase which shows the same issue
template <typename T>
struct List
{
struct D { int size; };
D *d;
List &fill(const T &t, int size = -1);
};
template <typename T>
List<T> &List<T>::fill(const T &t, int size)
{
resize(d->size);
return *this;
}
-----------------------
Comeau says this is invalid code but I don't know really.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
GCC build triplet|x86_64-redhat-linux |
GCC host triplet|x86_64-redhat-linux |
GCC target triplet|x86_64-redhat-linux |
Keywords| |accepts-invalid
Summary|[accept invalid] Invalid |Invalid template code
|template code accepted |accepted
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24680