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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281286
91177308-0d34-0410-b5e6-
96231b3b80d8
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);
}
--- /dev/null
+class S {
+ static_assert(4 == 4);
+};
--- /dev/null
+module a { header "a.h" }
--- /dev/null
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps \
+// RUN: -I%S/Inputs/static_assert -std=c++1z -verify %s
+// expected-no-diagnostics
+
+#include "a.h"
+
+S s;