diff options
| author | Jeffrey Yasskin <jyasskin@google.com> | 2010-06-05 01:39:57 +0000 |
|---|---|---|
| committer | Jeffrey Yasskin <jyasskin@google.com> | 2010-06-05 01:39:57 +0000 |
| commit | 2f96e9f5c90d5ad52734ca2b7a2aa68bf642a3a0 (patch) | |
| tree | f96c496cd803e82c658fd6fecc2d9fd0bd1399e4 /clang/lib/Sema | |
| parent | 0501b03242925e5d75a5e8478ae6e3b3aac5d3f1 (diff) | |
| download | bcm5719-llvm-2f96e9f5c90d5ad52734ca2b7a2aa68bf642a3a0.tar.gz bcm5719-llvm-2f96e9f5c90d5ad52734ca2b7a2aa68bf642a3a0.zip | |
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<typename T> struct set{};
struct Value {
template<typename T>
void set(T value) {
}
};
void foo() {
Value v;
v.set<double>(3.2); // Warning here.
}
llvm-svn: 105518
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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; |

