diff options
author | Richard Trieu <rtrieu@google.com> | 2016-09-13 01:20:40 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2016-09-13 01:20:40 +0000 |
commit | ffa532d7a1d964230ee7e4eaeb91678c47484325 (patch) | |
tree | f6661d5a53442c638b9a5a35d2bc7320e9e8f334 /clang/lib/Serialization/ASTReaderDecl.cpp | |
parent | eeb56abe643929f570006917c088e53bc7c896a4 (diff) | |
download | bcm5719-llvm-ffa532d7a1d964230ee7e4eaeb91678c47484325.tar.gz bcm5719-llvm-ffa532d7a1d964230ee7e4eaeb91678c47484325.zip |
Fix interaction between serialization and c++1z feature.
In c++1z, static_assert is not required to have a StringLiteral message, where
previously it was required. Update the AST Reader to be able to handle a
null StringLiteral.
llvm-svn: 281286
Diffstat (limited to 'clang/lib/Serialization/ASTReaderDecl.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTReaderDecl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp index d68d6d308a7..686c7f2e347 100644 --- a/clang/lib/Serialization/ASTReaderDecl.cpp +++ b/clang/lib/Serialization/ASTReaderDecl.cpp @@ -2239,7 +2239,7 @@ void ASTDeclReader::VisitStaticAssertDecl(StaticAssertDecl *D) { VisitDecl(D); D->AssertExprAndFailed.setPointer(Reader.ReadExpr(F)); D->AssertExprAndFailed.setInt(Record[Idx++]); - D->Message = cast<StringLiteral>(Reader.ReadExpr(F)); + D->Message = cast_or_null<StringLiteral>(Reader.ReadExpr(F)); D->RParenLoc = ReadSourceLocation(Record, Idx); } |