зеркало из https://github.com/microsoft/clang-1.git
Remove a const_cast by propagating constness to called functions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175161 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
65303900ea
Коммит
68a932d416
|
@ -745,7 +745,7 @@ public:
|
|||
unsigned Priority = CCP_CodePattern,
|
||||
CXCursorKind CursorKind = CXCursor_NotImplemented,
|
||||
CXAvailabilityKind Availability = CXAvailability_Available,
|
||||
NamedDecl *D = 0)
|
||||
const NamedDecl *D = 0)
|
||||
: Declaration(D), Pattern(Pattern), Priority(Priority), StartParameter(0),
|
||||
Kind(RK_Pattern), CursorKind(CursorKind), Availability(Availability),
|
||||
Hidden(false), QualifierIsInformative(0),
|
||||
|
|
|
@ -315,7 +315,7 @@ namespace {
|
|||
void ExitScope();
|
||||
|
||||
/// \brief Ignore this declaration, if it is seen again.
|
||||
void Ignore(Decl *D) { AllDeclsFound.insert(D->getCanonicalDecl()); }
|
||||
void Ignore(const Decl *D) { AllDeclsFound.insert(D->getCanonicalDecl()); }
|
||||
|
||||
/// \name Name lookup predicates
|
||||
///
|
||||
|
@ -3094,7 +3094,7 @@ static void MaybeAddOverrideCalls(Sema &S, DeclContext *InContext,
|
|||
M != MEnd; ++M) {
|
||||
CodeCompletionBuilder Builder(Results.getAllocator(),
|
||||
Results.getCodeCompletionTUInfo());
|
||||
CXXMethodDecl *Overridden = const_cast<CXXMethodDecl *>(*M);
|
||||
const CXXMethodDecl *Overridden = *M;
|
||||
if (Overridden->getCanonicalDecl() == Method->getCanonicalDecl())
|
||||
continue;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче