@@ -341,7 +341,9 @@ bool CheckNull(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
341
341
if (!Ptr.isZero ())
342
342
return true ;
343
343
const SourceInfo &Loc = S.Current ->getSource (OpPC);
344
- S.FFDiag (Loc, diag::note_constexpr_null_subobject) << CSK;
344
+ S.FFDiag (Loc, diag::note_constexpr_null_subobject)
345
+ << CSK << S.Current ->getRange (OpPC);
346
+
345
347
return false ;
346
348
}
347
349
@@ -350,7 +352,8 @@ bool CheckRange(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
350
352
if (!Ptr.isOnePastEnd ())
351
353
return true ;
352
354
const SourceInfo &Loc = S.Current ->getSource (OpPC);
353
- S.FFDiag (Loc, diag::note_constexpr_access_past_end) << AK;
355
+ S.FFDiag (Loc, diag::note_constexpr_access_past_end)
356
+ << AK << S.Current ->getRange (OpPC);
354
357
return false ;
355
358
}
356
359
@@ -359,7 +362,8 @@ bool CheckRange(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
359
362
if (!Ptr.isElementPastEnd ())
360
363
return true ;
361
364
const SourceInfo &Loc = S.Current ->getSource (OpPC);
362
- S.FFDiag (Loc, diag::note_constexpr_past_end_subobject) << CSK;
365
+ S.FFDiag (Loc, diag::note_constexpr_past_end_subobject)
366
+ << CSK << S.Current ->getRange (OpPC);
363
367
return false ;
364
368
}
365
369
@@ -369,7 +373,8 @@ bool CheckSubobject(InterpState &S, CodePtr OpPC, const Pointer &Ptr,
369
373
return true ;
370
374
371
375
const SourceInfo &Loc = S.Current ->getSource (OpPC);
372
- S.FFDiag (Loc, diag::note_constexpr_past_end_subobject) << CSK;
376
+ S.FFDiag (Loc, diag::note_constexpr_past_end_subobject)
377
+ << CSK << S.Current ->getRange (OpPC);
373
378
return false ;
374
379
}
375
380
0 commit comments