Skip to content

Commit 824a31c

Browse files
author
git apple-llvm automerger
committed
Merge commit '847186eb94bd' from llvm.org/main into next
2 parents 6a0f62c + 847186e commit 824a31c

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

clang/include/clang/ExtractAPI/ExtractAPIVisitor.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,9 @@ bool ExtractAPIVisitorBase<Derived>::VisitVarDecl(const VarDecl *Decl) {
266266

267267
if (Decl->isStaticDataMember()) {
268268
SymbolReference Context;
269-
auto Record = dyn_cast<RecordDecl>(Decl->getDeclContext());
269+
// getDeclContext() should return a RecordDecl since we
270+
// are currently handling a static data member.
271+
auto *Record = cast<RecordDecl>(Decl->getDeclContext());
270272
Context.Name = Record->getName();
271273
Context.USR = API.recordUSR(Record);
272274
auto Access = DeclarationFragmentsBuilder::getAccessControl(Decl);

clang/lib/ExtractAPI/DeclarationFragments.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,9 +688,9 @@ DeclarationFragmentsBuilder::getFragmentsForSpecialCXXMethod(
688688
const CXXMethodDecl *Method) {
689689
DeclarationFragments Fragments;
690690
std::string Name;
691-
if (isa<CXXConstructorDecl>(Method)) {
691+
if (const auto *Constructor = dyn_cast<CXXConstructorDecl>(Method)) {
692692
Name = Method->getNameAsString();
693-
if (dyn_cast<CXXConstructorDecl>(Method)->isExplicit())
693+
if (Constructor->isExplicit())
694694
Fragments.append("explicit", DeclarationFragments::FragmentKind::Keyword)
695695
.appendSpace();
696696
} else if (isa<CXXDestructorDecl>(Method))

clang/lib/Sema/SemaTemplateInstantiateDecl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5062,6 +5062,7 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
50625062
} IR{*this, PatternRec, NewRec};
50635063

50645064
TypeSourceInfo *NewSI = IR.TransformType(Function->getTypeSourceInfo());
5065+
assert(NewSI && "Type Transform failed?");
50655066
Function->setType(NewSI->getType());
50665067
Function->setTypeSourceInfo(NewSI);
50675068

0 commit comments

Comments
 (0)