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)
commitfd068271e6a15819fb5727710baf4f213b40f9ba
tree66409527631df0fac0012663fcf1d06fd5c892f3
parent67ccf9851c9494d5f5811187bfc26856ad597788
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.

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