through an invalid base.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360998
91177308-0d34-0410-b5e6-
96231b3b80d8
static CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E,
AccessKinds AK, const LValue &LVal,
QualType LValType) {
+ if (LVal.InvalidBase) {
+ Info.FFDiag(E);
+ return CompleteObject();
+ }
+
if (!LVal.Base) {
Info.FFDiag(E, diag::note_constexpr_access_null) << AK;
return CompleteObject();
copy5CharsIntoStrict(small.buf); // expected-error{{no matching function for call}}
}
}
+
+namespace InvalidBase {
+ // Ensure this doesn't crash.
+ struct S { const char *name; };
+ S invalid_base();
+ constexpr long bos_name = __builtin_object_size(invalid_base().name, 1);
+}