Allow more lookup of types in dependent base classes
authorReid Kleckner <reid@kleckner.net>
Tue, 8 Jul 2014 20:05:48 +0000 (20:05 +0000)
committerReid Kleckner <reid@kleckner.net>
Tue, 8 Jul 2014 20:05:48 +0000 (20:05 +0000)
commit1ba38f887929c42f7b20e691cc370c8c857352f8
tree40a40f9b58997d243682f7d60dcbbebc70b57d9c
parent3f5ad1a98e211216be9612a60ca30644e0f4073d
Allow more lookup of types in dependent base classes

MSVC appears to perform name lookup into dependent base classes when the
dependent base class has a known primary template.  This allows them to
know whether some unqualified ids are types or not, which allows them to
parse more class templates without typename keywords.

We can do the same thing when type name lookup fails, and if we find a
single type decl in one of our dependent base classes, recover as though
the user wrote 'typename MyClass::TypeFromBase'.

This allows us to parse some COM smart pointer classes in wrl/client.h
from the Windows 8 SDK.

Reviewers: rsmith

Differential Revision: http://reviews.llvm.org/D4237

llvm-svn: 212561
clang/lib/Sema/SemaDecl.cpp
clang/test/SemaTemplate/ms-lookup-template-base-classes.cpp