Currently the code in SemaCXXScopeSpec does an MSVCCompat fallback to delay lookup of possibly dependent base class names. It does so in all template bodies, even if the template is a simple function template.
Attached patch conditionalizes the compat fallback on whether the template function is part of a CXXRecordDecl as well, so that the dependent base class lookup workaround only happens when there's a chance of dependent base classes.
See discussion here:
http://permalink.gmane.org/gmane.comp.compilers.clang.devel/38225