Skip to content

Commit be1b384

Browse files
committed
Change ASTUnit::getASTContext() const to return a non-const ASTContext
Also, remove the non-const `ASTUnit::getASTContext()` since it's no longer necessary. This would make it similar to `Decl::getAstContext() const` for a more consistent and flexible API.
1 parent 8c61ef1 commit be1b384

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

clang/include/clang/Frontend/ASTUnit.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,7 @@ class ASTUnit {
439439
Preprocessor &getPreprocessor() { return *PP; }
440440
std::shared_ptr<Preprocessor> getPreprocessorPtr() const { return PP; }
441441

442-
const ASTContext &getASTContext() const { return *Ctx; }
443-
ASTContext &getASTContext() { return *Ctx; }
442+
ASTContext &getASTContext() const { return *Ctx; }
444443

445444
void setASTContext(ASTContext *ctx) { Ctx = ctx; }
446445
void setPreprocessor(std::shared_ptr<Preprocessor> pp);

0 commit comments

Comments
 (0)