summaryrefslogtreecommitdiff
path: root/clang/lib/AST/Interp/Record.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST/Interp/Record.cpp')
-rw-r--r--clang/lib/AST/Interp/Record.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/AST/Interp/Record.cpp b/clang/lib/AST/Interp/Record.cpp
index 8ded765fc1c4..ac01524e1caf 100644
--- a/clang/lib/AST/Interp/Record.cpp
+++ b/clang/lib/AST/Interp/Record.cpp
@@ -49,11 +49,11 @@ const Record::Base *Record::getBase(const RecordDecl *FD) const {
}
const Record::Base *Record::getBase(QualType T) const {
- if (!T->isRecordType())
- return nullptr;
-
- const RecordDecl *RD = T->getAs<RecordType>()->getDecl();
- return BaseMap.lookup(RD);
+ if (auto *RT = T->getAs<RecordType>()) {
+ const RecordDecl *RD = RT->getDecl();
+ return BaseMap.lookup(RD);
+ }
+ return nullptr;
}
const Record::Base *Record::getVirtualBase(const RecordDecl *FD) const {