Use mutable instead of const_cast
This commit is contained in:
parent
1f571549e7
commit
d1fe76f322
|
@ -29,7 +29,7 @@ void CodeGenerator::addDeclaration(clang::Decl *decl)
|
|||
void CodeGenerator::lazyInitializeSourceManager() const
|
||||
{
|
||||
if (factory().compilerInstance()) {
|
||||
const_cast<CodeGenerator *>(this)->m_sourceManager = &factory().compilerInstance()->getSourceManager();
|
||||
m_sourceManager = &factory().compilerInstance()->getSourceManager();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ protected:
|
|||
|
||||
private:
|
||||
CodeFactory &m_factory;
|
||||
const clang::SourceManager *m_sourceManager;
|
||||
mutable const clang::SourceManager *m_sourceManager;
|
||||
};
|
||||
|
||||
inline CodeGenerator::CodeGenerator(CodeFactory &factory)
|
||||
|
|
Loading…
Reference in New Issue