Article View: comp.std.c++
Article #3376Re: default template args in a typedef
From: Jason Merrill
Date: Tue, 20 Feb 1996 18:56
Date: Tue, 20 Feb 1996 18:56
37 lines
1606 bytes
1606 bytes
>>>>> Tim Hollebeek <tim@franck.Princeton.EDU> writes:
> Is this legal?
> -------
> template <class T>
> class X {
> };
> template <class T, class U = X<T> >
> class Y {
> };
> typedef Y<double, X<double> > Z1;
> typedef Y<double> Z2;
> int main() {
> Z1 z1;
> Z2 z2; // <--- here
> }
> -------
> g++ 2.7.2 doesn't mind Z1, but gives:
> aggregate `Y<...> z2' has incomplete type and cannot be initialized
> on the Z2 line.
This is a bug in g++ 2.7.2.
Jason
---
[ To submit articles: Try just posting with your newsreader. If that fails,
use mailto:std-c++@ncar.ucar.edu
FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html
Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html
Comments? mailto:std.c++-request@ncar.ucar.edu
]
Technical Details
Message-ID:
<u9wx5i5kyw.fsf@yorick.cygnus.com>Path:
arc1-ca.pugleaf.net!chronicle.mti.sgi.com!austernReferences:
<4g5ddd$56t@cnn.Princeton.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!chronicle.mti.sgi.com!austern From: jason@cygnus.com (Jason Merrill) Newsgroups: comp.std.c++ Subject: Re: default template args in a typedef Date: 20 Feb 1996 10:56:51 PST Organization: Cygnus Support, Mountain View, CA Approved: austern@isolde.mti.sgi.com Message-ID: <u9wx5i5kyw.fsf@yorick.cygnus.com> References: <4g5ddd$56t@cnn.Princeton.EDU> NNTP-Posting-Host: isolde.mti.sgi.com X-Original-Date: 20 Feb 1996 02:51:03 -0800 In-Reply-To: tim@franck.Princeton.EDU's message of 19 Feb 96 02:23:48 GMT X-Newsreader: Gnus v5.0 X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBVAwUBMSoZk0y4NqrwXLNJAQGiHAIAyhiOIXXdXcMG+8Xn0dRDaXjK0NDJJMlB 8ER9jp6tYRhkS9Bk097GjTuGkFNJVkk2UC5w4WUwZjvGXCUfobpbVw== =HgVE Originator: austern@isolde.mti.sgi.com