diff --git a/clang/Sema/SemaDecl.cpp b/clang/Sema/SemaDecl.cpp index 4510f00d0c1e..425743aa320f 100644 --- a/clang/Sema/SemaDecl.cpp +++ b/clang/Sema/SemaDecl.cpp @@ -965,8 +965,9 @@ Sema::DeclTy *Sema::ParseEnumConstant(Scope *S, DeclTy *theEnumDecl, Id->getName()); // FIXME: Don't leak memory: delete Val; Val = 0; // Just forget about it. + } else { + EltTy = Val->getType(); } - EltTy = Val->getType(); } if (!Val) {