LookupResult R(*this, TName, Name.getSourceRange().getBegin(),
LookupOrdinaryName);
- R.suppressDiagnostics();
LookupTemplateName(R, S, SS, ObjectType, EnteringContext,
MemberOfUnknownSpecialization);
- if (R.empty() || R.isAmbiguous())
+ if (R.empty() || R.isAmbiguous()) {
+ R.suppressDiagnostics();
return TNK_Non_template;
+ }
TemplateName Template;
TemplateNameKind TemplateKind;
// template name in other ways.
Template = Context.getOverloadedTemplateName(R.begin(), R.end());
TemplateKind = TNK_Function_template;
+
+ // We'll do this lookup again later.
+ R.suppressDiagnostics();
} else {
TemplateDecl *TD = cast<TemplateDecl>((*R.begin())->getUnderlyingDecl());
Template = TemplateName(TD);
}
- if (isa<FunctionTemplateDecl>(TD))
+ if (isa<FunctionTemplateDecl>(TD)) {
TemplateKind = TNK_Function_template;
- else {
+
+ // We'll do this lookup again later.
+ R.suppressDiagnostics();
+ } else {
assert(isa<ClassTemplateDecl>(TD) || isa<TemplateTemplateParmDecl>(TD));
TemplateKind = TNK_Type_template;
}
void b() { throw A(); } // expected-error{{temporary of type 'test16::A' has private destructor}} \
// expected-error{{exception object of type 'test16::A' has private destructor}}
}
+
+// rdar://problem/8146294
+namespace test17 {
+ class A {
+ template <typename T> class Inner { }; // expected-note {{declared private here}}
+ };
+
+ A::Inner<int> s; // expected-error {{'Inner' is a private member of 'test17::A'}}
+}