summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-10-10 17:49:49 +0000
committerChris Lattner <sabre@nondot.org>2010-10-10 17:49:49 +0000
commit001b29ccc1ee5d0a884c90f30a9660f1f4b360cf (patch)
treeb2a32863180a087bbe01c2579370f6bbd88aa99e /clang/lib
parent52bea03e7a6f608d337f32f3c47b5d62f64204ad (diff)
downloadbcm5719-llvm-001b29ccc1ee5d0a884c90f30a9660f1f4b360cf.tar.gz
bcm5719-llvm-001b29ccc1ee5d0a884c90f30a9660f1f4b360cf.zip
Allow a string literal to initialize a tail array (PR8217), patch
by Pierre Habouzit! llvm-svn: 116165
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaInit.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp
index bac9f8fa755..7f0f2767c64 100644
--- a/clang/lib/Sema/SemaInit.cpp
+++ b/clang/lib/Sema/SemaInit.cpp
@@ -1474,7 +1474,8 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity,
Invalid = true;
}
- if (!hadError && !isa<InitListExpr>(DIE->getInit())) {
+ if (!hadError && !isa<InitListExpr>(DIE->getInit()) &&
+ !isa<StringLiteral>(DIE->getInit())) {
// The initializer is not an initializer list.
SemaRef.Diag(DIE->getInit()->getSourceRange().getBegin(),
diag::err_flexible_array_init_needs_braces)
OpenPOWER on IntegriCloud