summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorKaelyn Uhrain <rikka@google.com>2011-08-18 21:57:36 +0000
committerKaelyn Uhrain <rikka@google.com>2011-08-18 21:57:36 +0000
commit40aa7c91b6dd78d1ebf539cdfd49428bb2bf53e4 (patch)
treeb7287c2f60e6f7779c9b98f511e11845bd7d0357 /clang/lib
parent90103ccc0577bbf8991d7b4f4e4e7ea2b12141d7 (diff)
downloadbcm5719-llvm-40aa7c91b6dd78d1ebf539cdfd49428bb2bf53e4.tar.gz
bcm5719-llvm-40aa7c91b6dd78d1ebf539cdfd49428bb2bf53e4.zip
Don't accept a typo correction if the corrected identifier is the same as the
uncorrected identifier. Fixes a problem pointed out by Eli. llvm-svn: 137987
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 898fca4203d..106363f6d73 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -4235,7 +4235,8 @@ static void DiagnoseInvalidRedeclaration(Sema &S, FunctionDecl *NewFD,
}
// If the qualified name lookup yielded nothing, try typo correction
} else if ((Correction = S.CorrectTypo(Prev.getLookupNameInfo(),
- Prev.getLookupKind(), 0, 0, DC))) {
+ Prev.getLookupKind(), 0, 0, DC)) &&
+ Correction.getCorrection() != Name) {
DiagMsg = isFriendDecl ? diag::err_no_matching_local_friend_suggest
: diag::err_member_def_does_not_match_suggest;
for (TypoCorrection::decl_iterator CDecl = Correction.begin(),
OpenPOWER on IntegriCloud