]> granicus.if.org Git - clang/commit
Allow typo correction to try removing nested name specifiers.
authorKaelyn Uhrain <rikka@google.com>
Tue, 2 Jul 2013 23:47:44 +0000 (23:47 +0000)
committerKaelyn Uhrain <rikka@google.com>
Tue, 2 Jul 2013 23:47:44 +0000 (23:47 +0000)
commitb2567ddad9a1142d7224e5363029d640e8f4f59d
tree0b783da9dada66d45b8c821687b0d70b7b9d4ba6
parentcaa16dd469b6f7bfb5bce05afd8772f5d4196322
Allow typo correction to try removing nested name specifiers.

The removal is tried by retrying the failed lookup of a correction
candidate with either the MemberContext or SS (CXXScopeSpecifier) or
both set to NULL if they weren't already. If the candidate identifier
is then looked up successfully, make a note in the candidate that the
SourceRange should include any existing nested name specifier even if
the candidate isn't adding a different one (i.e. the candidate has a
NULL NestedNameSpecifier).

Also tweak the diagnostic messages to differentiate between a suggestion
that just replaces the identifer but leaves the existing nested name
specifier intact and one that replaces the entire qualified identifier,
in cases where the suggested replacement is unqualified.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185487 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Sema/TypoCorrection.h
lib/Sema/SemaCXXScopeSpec.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaDeclCXX.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaExprMember.cpp
lib/Sema/SemaLookup.cpp
lib/Sema/SemaTemplate.cpp
test/CXX/dcl.dcl/basic.namespace/namespace.def/p8.cpp
test/FixIt/typo.cpp
test/Parser/cxx-using-directive.cpp
test/SemaCXX/pr13394-crash-on-invalid.cpp