From fb3f9ba969e3ec5b31d0286f53f978363c5d9623 Mon Sep 17 00:00:00 2001 From: John McCall Date: Sat, 28 Aug 2010 20:17:00 +0000 Subject: If filtering a lookup result leaves it ambiguous, keep the ambiguity kind. Fixes PR7252. llvm-svn: 112383 --- clang/lib/Sema/SemaTemplate.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'clang/lib/Sema/SemaTemplate.cpp') diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 09656bcd915..2cbf3073a46 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -141,8 +141,13 @@ TemplateNameKind Sema::isTemplateName(Scope *S, LookupOrdinaryName); LookupTemplateName(R, S, SS, ObjectType, EnteringContext, MemberOfUnknownSpecialization); - if (R.empty() || R.isAmbiguous()) { + if (R.empty()) return TNK_Non_template; + if (R.isAmbiguous()) { + // Suppress diagnostics; we'll redo this lookup later. R.suppressDiagnostics(); + + // FIXME: we might have ambiguous templates, in which case we + // should at least parse them properly! return TNK_Non_template; } -- cgit v1.2.3