diff options
author | Richard Smith <richard@metafoo.co.uk> | 2020-09-21 14:52:06 -0700 |
---|---|---|
committer | Richard Smith <richard@metafoo.co.uk> | 2020-09-21 15:25:19 -0700 |
commit | 0f6facca9701f6df87d13e55d70bd7111a0472aa (patch) | |
tree | 621f334fd855a6023460b16296d2e7f0da138ed1 /clang/lib/Sema/SemaInit.cpp | |
parent | 6a6b06f5262bb96523eceef4a42fe8e60ae2a630 (diff) | |
download | llvm-0f6facca9701f6df87d13e55d70bd7111a0472aa.zip llvm-0f6facca9701f6df87d13e55d70bd7111a0472aa.tar.gz llvm-0f6facca9701f6df87d13e55d70bd7111a0472aa.tar.bz2 |
Don't build a StringLiteral expression with reference type when
performing list-initialization of a char array reference from a braced
string literal of a smaller size.
Diffstat (limited to 'clang/lib/Sema/SemaInit.cpp')
-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 ab82f85..a9f707b 100644 --- a/clang/lib/Sema/SemaInit.cpp +++ b/clang/lib/Sema/SemaInit.cpp @@ -8420,7 +8420,8 @@ ExprResult InitializationSequence::Perform(Sema &S, case SK_StringInit: { QualType Ty = Step->Type; - CheckStringInit(CurInit.get(), ResultType ? *ResultType : Ty, + bool UpdateType = ResultType && Entity.getType()->isIncompleteArrayType(); + CheckStringInit(CurInit.get(), UpdateType ? *ResultType : Ty, S.Context.getAsArrayType(Ty), S); break; } |