diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-10-10 17:49:49 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-10-10 17:49:49 +0000 |
| commit | 001b29ccc1ee5d0a884c90f30a9660f1f4b360cf (patch) | |
| tree | b2a32863180a087bbe01c2579370f6bbd88aa99e /clang/lib | |
| parent | 52bea03e7a6f608d337f32f3c47b5d62f64204ad (diff) | |
| download | bcm5719-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.cpp | 3 |
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) |

