From 2f96e9f5c90d5ad52734ca2b7a2aa68bf642a3a0 Mon Sep 17 00:00:00 2001 From: Jeffrey Yasskin Date: Sat, 5 Jun 2010 01:39:57 +0000 Subject: Add an extension to avoid an error when a global template has the same name as a member template, and you try to call the member template with an explicit template argument. See PR7247 For example, this downgrades the error to a warning in: template struct set{}; struct Value { template void set(T value) { } }; void foo() { Value v; v.set(3.2); // Warning here. } llvm-svn: 105518 --- clang/lib/Sema/SemaTemplate.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'clang/lib/Sema') diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 08f261642be..f77454b0594 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -311,8 +311,9 @@ void Sema::LookupTemplateName(LookupResult &Found, Found.getFoundDecl()->getCanonicalDecl() != FoundOuter.getFoundDecl()->getCanonicalDecl()) { Diag(Found.getNameLoc(), - diag::err_nested_name_member_ref_lookup_ambiguous) - << Found.getLookupName(); + diag::ext_nested_name_member_ref_lookup_ambiguous) + << Found.getLookupName() + << ObjectType; Diag(Found.getRepresentativeDecl()->getLocation(), diag::note_ambig_member_ref_object_type) << ObjectType; -- cgit v1.2.3