MS compat: Allow lookup of types from dependent bases in functions
authorReid Kleckner <reid@kleckner.net>
Tue, 8 Jul 2014 21:35:03 +0000 (21:35 +0000)
committerReid Kleckner <reid@kleckner.net>
Tue, 8 Jul 2014 21:35:03 +0000 (21:35 +0000)
commit16251bd5aff05d7a08009232b361b49556926708
treee68173269f66137e5c9abf7e1d699a14eb21259b
parente5274ba3457d6c18ecadfb44f1cf8f7e0e689111
MS compat: Allow lookup of types from dependent bases in functions

If we want to resolve the remaining FIXMEs here, we probably want to
extend the main lookup mechanism to perform lookup into dependent bases,
but we would have to tread lightly.  Adding more name lookup has major
impact on compile time.

If we did extend the main mechanism, we would add a flag to LookupResult
that allows us to find names from dependent base classes where the base
is a specialization of a known template.  The final LookupResult would
still return LookupResult::NotFoundInCurrentInstantiation, but it would
have a collection of Decls.  If we find a real lookup result, we would
clear the flag and the existing lookup results and begin accumulating
only real lookup results.

We would structure the lookup as a secondary lookup between normal
lookup and typo correction for normal compilation, but for MSVC
compatibility mode, we would always enable this extra lookup into
dependent bases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212566 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaDecl.cpp
test/SemaTemplate/ms-lookup-template-base-classes.cpp