diff options
author | Hans Wennborg <hans@hanshq.net> | 2013-05-16 09:22:40 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2013-05-16 09:22:40 +0000 |
commit | 950f318ff1ab860881f5939cb1cdeef2337e3967 (patch) | |
tree | ff347264dac204f4b7ca9bee0c1217081d9c7882 /clang | |
parent | 1e7643243d3fe777963d24c571232abd97bb8fe7 (diff) | |
download | bcm5719-llvm-950f318ff1ab860881f5939cb1cdeef2337e3967.tar.gz bcm5719-llvm-950f318ff1ab860881f5939cb1cdeef2337e3967.zip |
SemaInit.cpp: give both IsStringInit() functions the same return type.
This addresses Richard's comment on r181880.
llvm-svn: 181995
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/Sema/SemaInit.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp index a3b78787e43..f7b53b2be21 100644 --- a/clang/lib/Sema/SemaInit.cpp +++ b/clang/lib/Sema/SemaInit.cpp @@ -120,11 +120,12 @@ static StringInitFailureKind IsStringInit(Expr *Init, const ArrayType *AT, llvm_unreachable("missed a StringLiteral kind?"); } -static bool IsStringInit(Expr* init, QualType declType, ASTContext& Context) { +static StringInitFailureKind IsStringInit(Expr *init, QualType declType, + ASTContext &Context) { const ArrayType *arrayType = Context.getAsArrayType(declType); if (!arrayType) - return false; - return IsStringInit(init, arrayType, Context) == SIF_None; + return SIF_Other; + return IsStringInit(init, arrayType, Context); } /// Update the type of a string literal, including any surrounding parentheses, @@ -712,7 +713,8 @@ void InitListChecker::CheckExplicitInitList(const InitializedEntity &Entity, } if (StructuredIndex == 1 && - IsStringInit(StructuredList->getInit(0), T, SemaRef.Context)) { + IsStringInit(StructuredList->getInit(0), T, SemaRef.Context) == + SIF_None) { unsigned DK = diag::warn_excess_initializers_in_char_array_initializer; if (SemaRef.getLangOpts().CPlusPlus) { DK = diag::err_excess_initializers_in_char_array_initializer; |