This is an archive of the discontinued LLVM Phabricator instance.

Fis for Assertion failure on dependent expression.
ClosedPublic

Authored by Sunil_Srivastava on Jan 11 2021, 11:25 AM.

Details

Summary

The check for the value passed to __buildtin_return_address needs to be guarded by check for the Dependent context, or else it runs into an assertion failure in the test case given below.

Diff Detail

Event Timeline

Sunil_Srivastava requested review of this revision.Jan 11 2021, 11:25 AM
Sunil_Srivastava created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 11 2021, 11:25 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
erichkeane accepted this revision.Jan 11 2021, 11:34 AM

Fix looks fine, I'm on the fence about how to handle the test, whether it is valuable to convert it to a C++ test and omit the #ifdef/extra run line, or leave it as it is (without the 2nd run with Wmost).

I'll leave the opinion here to other reviewers/submitter to deal with before commit.

clang/test/Sema/builtin-returnaddress.c
3

I don't think the -Wmost test 'RUN' line is valuable for the C++ mode, it is simply validating that this diagnostic is in Wmost mode (which running in C mode is sufficient).

This revision is now accepted and ready to land.Jan 11 2021, 11:34 AM
Sunil_Srivastava marked an inline comment as done.Jan 11 2021, 9:08 PM
Sunil_Srivastava added inline comments.
clang/test/Sema/builtin-returnaddress.c
3

Good point. I will remove that.

This revision was automatically updated to reflect the committed changes.
Sunil_Srivastava marked an inline comment as done.