This is an archive of the discontinued LLVM Phabricator instance.

[SemaExprCXX] Avoid calling isInSystemHeader for invalid source locations
ClosedPublic

Authored by labath on Mar 3 2016, 3:30 AM.

Details

Summary

While diagnosing a CXXNewExpr warning, we were calling isInSystemHeader(), which expect to be
called with a valid source location. This causes an assertion failure if the location is unknown.
A quick grep shows it's not without precedent to guard calls to the function with a
"Loc.isValid()".

This fixes a test failure in LLDB, which always creates object with invalid source locations as it
does not (always) have access to the source.

Diff Detail

Event Timeline

labath updated this revision to Diff 49725.Mar 3 2016, 3:30 AM
labath retitled this revision from to [SemaExprCXX] Avoid calling isInSystemHeader for invalid source locations.
labath updated this object.
labath added a reviewer: nlewycky.
labath added subscribers: cfe-commits, lldb-commits.
nlewycky accepted this revision.Mar 3 2016, 9:59 AM
nlewycky edited edge metadata.
This revision is now accepted and ready to land.Mar 3 2016, 9:59 AM
This revision was automatically updated to reflect the committed changes.