Fix some minor issues found by Coverity.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 18 Jul 2016 22:37:35 +0000 (22:37 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 18 Jul 2016 22:37:35 +0000 (22:37 +0000)
llvm-svn: 275925

clang/include/clang/AST/DeclCXX.h
clang/lib/AST/ExprConstant.cpp
clang/lib/AST/ItaniumMangle.cpp

index 66acfee..7c53554 100644 (file)
@@ -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,
index 7573135..760cda9 100644 (file)
@@ -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:
index 694fde3..51de561 100644 (file)
@@ -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<CXXRecordDecl>(RD);
-    if (CXXRD->isLambda()) {
+    if (CXXRD && CXXRD->isLambda()) {
       if (const ParmVarDecl *Parm
               = dyn_cast_or_null<ParmVarDecl>(CXXRD->getLambdaContextDecl())) {
         if (const FunctionDecl *Func