ok now with the patch.
On Mon, Nov 7, 2011 at 6:32 AM, Francois Pichet <[email protected]> wrote: > Hi, > > This is my solution to the problem of missing typename in MSVC headers. > This patch resolves all the cases of missing typename in MSVC 2008 > standard c++ headers and in MFC code. > > > This deals with 2 situations: > > 1. T::a where T is a TemplateTypeParmType. > In this case we depend on late template parsing to subtitute 'T' with > the actual type and then perform a name lookup to check if 'a' is a > type. > > > 2. ClassName<T>::a > In this case, we'll perform a name lookup in the class template > 'ClassName' to check if 'a' ia a type in the pattern. > > > Example: > > class C { > public: > typedef int type_1; > }; > > template <class T> > class D { > public: > typedef T type_2; > }; > > template <class T> > void f() { > T::type_1 var1; // case 1. > D<T>::type_2 var2; // case 2. > > } > int main() { > f<C>(); > } > > I admit this is a hack, that's why I am asking for review. > But given the way clang and MSVC differ in handling template code, I > think this is the best we can do. >
MicrosoftMissingTypename.patch
Description: Binary data
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
