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:
Dmitri Gribenko 2013-02-14 13:53:30 +00:00
Родитель 65303900ea
Коммит 68a932d416
2 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -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;