This is an archive of the discontinued LLVM Phabricator instance.

[asan] Do not return void expression.
Needs ReviewPublic

Authored by tetsuok on Apr 17 2014, 8:23 AM.

Details

Reviewers
kcc
Summary

Although clang++ does not warn this, it's better to avoid returning void
expression.

Diff Detail

Event Timeline

kcc added a comment.Apr 17 2014, 9:46 AM

what's so bad in returning void expression from a function returning void?
Not that I assert it's a great practice, but it makes the code shorter and I can't imagine where it can lead to problems.
If this is indeed a bad pattern, let's implement a clang warning.

Sorry. You're right. This is valid in C++ standard. I thought that this should be avoided because clang warns in C code. I personally avoid this pattern in C++. I should have checked the standard before sending this patch.