This is an archive of the discontinued LLVM Phabricator instance.

[clang][Interp] Handle __extension__ unary operators
ClosedPublic

Authored by tbaeder on Apr 19 2023, 12:16 AM.

Details

Summary

AFAIK this is just used to suppress warnings, so ignore it altogether.

Diff Detail

Event Timeline

tbaeder created this revision.Apr 19 2023, 12:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 19 2023, 12:16 AM
tbaeder requested review of this revision.Apr 19 2023, 12:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 19 2023, 12:16 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
tbaeder added inline comments.Apr 19 2023, 12:16 AM
clang/test/AST/Interp/literals.cpp
864–881

It's weird that the above two statements warn about using __FUNCTION__ and the return statement doesn't.

erichkeane added inline comments.Apr 19 2023, 6:21 AM
clang/test/AST/Interp/literals.cpp
864–881

Aren't they warning about it being 'unused'? If so, the 'return' uses them...

tbaeder added inline comments.Apr 19 2023, 6:24 AM
clang/test/AST/Interp/literals.cpp
864–881

Right, my message wasn't clear but I meant the c++14 extension diagnostic: https://godbolt.org/z/Kso8qv7jh

aaron.ballman accepted this revision.May 2 2023, 9:02 AM

LGTM

clang/test/AST/Interp/literals.cpp
864–881

That is pretty strange, tbh. Might be worth investigating in a follow-up.

This revision is now accepted and ready to land.May 2 2023, 9:02 AM
tbaeder added inline comments.May 2 2023, 10:53 AM
clang/test/AST/Interp/literals.cpp
864–881

Yeah, in CheckConstexprFunctionStmt in SemaDeclCXX.cpp, the return expression is not checked.

This revision was landed with ongoing or failed builds.Jul 25 2023, 10:17 PM
This revision was automatically updated to reflect the committed changes.