From: Richard Smith Date: Mon, 18 Jul 2016 22:37:35 +0000 (+0000) Subject: Fix some minor issues found by Coverity. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ba7cbd565d78035ceed2ed50a907596813bc7a7d;p=clang Fix some minor issues found by Coverity. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275925 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/DeclCXX.h b/include/clang/AST/DeclCXX.h index 66acfee60d..7c535546f4 100644 --- a/include/clang/AST/DeclCXX.h +++ b/include/clang/AST/DeclCXX.h @@ -2964,7 +2964,9 @@ class ConstructorUsingShadowDecl final : public UsingShadowDecl { } } ConstructorUsingShadowDecl(ASTContext &C, EmptyShell Empty) - : UsingShadowDecl(ConstructorUsingShadow, C, Empty) {} + : UsingShadowDecl(ConstructorUsingShadow, C, Empty), + NominatedBaseClassShadowDecl(), ConstructedBaseClassShadowDecl(), + IsVirtual(false) {} public: static ConstructorUsingShadowDecl *Create(ASTContext &C, DeclContext *DC, diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index 7573135302..760cda99c5 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -6872,6 +6872,8 @@ bool IntExprEvaluator::VisitCallExpr(const CallExpr *E) { // Reduce it to a constant now. return Success((Type & 2) ? 0 : -1, E); } + + llvm_unreachable("unexpected EvalMode"); } case Builtin::BI__builtin_bswap16: diff --git a/lib/AST/ItaniumMangle.cpp b/lib/AST/ItaniumMangle.cpp index 694fde3175..51de561d5f 100644 --- a/lib/AST/ItaniumMangle.cpp +++ b/lib/AST/ItaniumMangle.cpp @@ -1471,7 +1471,7 @@ void CXXNameMangler::mangleLocalName(const Decl *D, // numbering will be local to the particular argument in which it appears // -- other default arguments do not affect its encoding. const CXXRecordDecl *CXXRD = dyn_cast(RD); - if (CXXRD->isLambda()) { + if (CXXRD && CXXRD->isLambda()) { if (const ParmVarDecl *Parm = dyn_cast_or_null(CXXRD->getLambdaContextDecl())) { if (const FunctionDecl *Func