BUG: C2321 Expanding Template with a Pointer to a Nested ClassLast reviewed: July 31, 1997Article ID: Q150885 |
The information in this article applies to:
SYMPTOMSAt the point where a class template is expanded using the new operator to a nested class, the compiler reports the following errors:
[FileName](10) : error C2321: syntax error : unexpected 'A::B' [FileName](27) : fatal error C1004: unexpected end of file found STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
WORKAROUNDThere are two possible workarounds to this problem. Each is stated in terms of the sample code below:
Sample Code
/* Compile options needed: None */ template <class T> class C { public: C(); private: T *t; }; template <class T> C<T>::C() : t(new T()) // error { } class A { public: class B { }; }; main() { C<A::B> c; return 0; } Keywords : CLIss vcbuglist400 vcbuglist500 Version : 4.0 4.1 4.2 5.0 Platform : NT WINDOWS Issue type : kbbug |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |